tor-browser

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

15.2.3.6-4-247.js (1072B)


      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-247
      6 description: >
      7    Object.defineProperty - 'O' is an Array, 'name' is an array index
      8    named property, 'name' is data property and 'desc' is data
      9    descriptor, and the [[Configurable]] attribute value of 'name' is
     10    false, test TypeError is thrown if the [[Writable]] attribute
     11    value of 'name' is false, and the [[Value]] field of 'desc' is -0,
     12    and the [[Value]] attribute value of 'name' is +0 (15.4.5.1 step
     13    4.c)
     14 includes: [propertyHelper.js]
     15 ---*/
     16 
     17 var arrObj = [];
     18 
     19 Object.defineProperty(arrObj, "1", {
     20  value: +0
     21 });
     22 
     23 try {
     24 
     25  Object.defineProperty(arrObj, "1", {
     26    value: -0
     27  });
     28  throw new Test262Error("Expected an exception.");
     29 } catch (e) {
     30  if (!(e instanceof TypeError)) {
     31    throw new Test262Error("Expected TypeError, got " + e);
     32  }
     33 }
     34 
     35 verifyProperty(arrObj, "1", {
     36  value: +0,
     37  writable: false,
     38  enumerable: false,
     39  configurable: false,
     40 });
     41 
     42 reportCompare(0, 0);