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-87.js (994B)


      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-87
      6 description: >
      7    Object.defineProperties throws TypeError when P.configurable is
      8    false, both properties.[[Set]] and P.[[Set]] are two objects which
      9    refer to different objects (8.12.9 step 11.a.i)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 function set_func1(value) {
     17  obj.setVerifyHelpProp = value;
     18 }
     19 
     20 Object.defineProperty(obj, "foo", {
     21  set: set_func1,
     22  configurable: false
     23 });
     24 
     25 function set_func2() {}
     26 
     27 try {
     28  Object.defineProperties(obj, {
     29    foo: {
     30      set: set_func2
     31    }
     32  });
     33  throw new Test262Error("Expected an exception.");
     34 } catch (e) {
     35  if (!(e instanceof TypeError)) {
     36    throw new Test262Error("Expected TypeError, got " + e);
     37  }
     38 }
     39 
     40 verifyWritable(obj, "foo", "setVerifyHelpProp");
     41 
     42 verifyProperty(obj, "foo", {
     43  enumerable: false,
     44  configurable: false,
     45 });
     46 
     47 reportCompare(0, 0);