tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

15.2.3.7-6-a-92.js (1021B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 es5id: 15.2.3.7-6-a-92
      6 description: >
      7    Object.defineProperties throws TypeError when P.configurable is
      8    false, P.[[Get]] is undefined, properties.[[Get]] refers to an
      9    objcet (8.12.9 step 11.a.ii)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 function set_func(value) {
     17  obj.setVerifyHelpProp = value;
     18 }
     19 
     20 Object.defineProperty(obj, "foo", {
     21  get: undefined,
     22  set: set_func,
     23  enumerable: false,
     24  configurable: false
     25 });
     26 
     27 function get_func() {
     28  return 0;
     29 }
     30 
     31 try {
     32  Object.defineProperties(obj, {
     33    foo: {
     34      get: get_func
     35    }
     36  });
     37  throw new Test262Error("Expected an exception.");
     38 } catch (e) {
     39  verifyWritable(obj, "foo", "setVerifyHelpProp");
     40 
     41  if (!(e instanceof TypeError)) {
     42    throw new Test262Error("Expected TypeError, got " + e);
     43  }
     44 }
     45 
     46 verifyProperty(obj, "foo", {
     47  enumerable: false,
     48  configurable: false,
     49 });
     50 
     51 reportCompare(0, 0);