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-240.js (1104B)


      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-240
      6 description: >
      7    Object.defineProperties - TypeError is thrown if 'O' is an Array,
      8    'P' is an array index named property that already exists on 'O' is
      9    data property with  [[Configurable]], [[Writable]] false, 'desc'
     10    is data descriptor, [[Value]] field of 'desc' and the [[Value]]
     11    attribute value of 'P' are two objects which refer to the
     12    different objects (15.4.5.1 step 4.c)
     13 includes: [propertyHelper.js]
     14 ---*/
     15 
     16 var arr = [];
     17 var obj1 = {
     18  value: 12
     19 };
     20 var obj2 = {
     21  value: 36
     22 };
     23 
     24 Object.defineProperty(arr, "1", {
     25  value: obj1
     26 });
     27 
     28 try {
     29  Object.defineProperties(arr, {
     30    "1": {
     31      value: obj2
     32    }
     33  });
     34 
     35  throw new Test262Error("Expected an exception.");
     36 } catch (e) {
     37  if (!(e instanceof TypeError)) {
     38    throw new Test262Error("Expected TypeError, got " + e);
     39  }
     40 }
     41 
     42 verifyProperty(arr, "1", {
     43  value: obj1,
     44  writable: false,
     45  enumerable: false,
     46  configurable: false,
     47 });
     48 
     49 reportCompare(0, 0);