tor-browser

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

15.2.3.6-4-86.js (859B)


      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-86
      6 description: >
      7    Object.defineProperty will throw TypeError when name.configurable
      8    = false, name.writable = false, desc.value = +0 and name.value =
      9    -0 (8.12.9 step 10.a.ii.1)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 Object.defineProperty(obj, "foo", {
     17  value: -0,
     18  writable: false,
     19  configurable: false
     20 });
     21 
     22 try {
     23  Object.defineProperty(obj, "foo", {
     24    value: +0
     25  });
     26  throw new Test262Error("Expected an exception.");
     27 } catch (e) {
     28  if (!(e instanceof TypeError)) {
     29    throw new Test262Error("Expected TypeError, got " + e);
     30  }
     31 }
     32 
     33 verifyProperty(obj, "foo", {
     34  value: -0,
     35  writable: false,
     36  enumerable: false,
     37  configurable: false,
     38 });
     39 
     40 reportCompare(0, 0);