tor-browser

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

15.2.3.6-4-99.js (982B)


      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.6-4-99
      6 description: >
      7    Object.defineProperty will throw TypeError when name.configurable
      8    = false, name.[[Get]] is undefined, desc.[[Get]] refers to an
      9    object (8.12.9 step 11.a.ii)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 function setFunc(value) {
     17  obj.setVerifyHelpProp = value;
     18 }
     19 
     20 Object.defineProperty(obj, "foo", {
     21  set: setFunc,
     22  configurable: false
     23 });
     24 
     25 function getFunc() {
     26  return 10;
     27 }
     28 
     29 try {
     30  Object.defineProperty(obj, "foo", {
     31    get: getFunc,
     32    set: setFunc
     33  });
     34  throw new Test262Error("Expected an exception.");
     35 } catch (e) {
     36  verifyWritable(obj, "foo", "setVerifyHelpProp");
     37 
     38  if (!(e instanceof TypeError)) {
     39    throw new Test262Error("Expected TypeError, got " + e);
     40  }
     41 }
     42 
     43 verifyProperty(obj, "foo", {
     44  enumerable: false,
     45  configurable: false,
     46 });
     47 
     48 reportCompare(0, 0);