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-93-4.js (1153B)


      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-93-4
      6 description: >
      7    Object.defineProperties will fail to update [[Value]] attribute of
      8    indexed data property 'P' when [[Configurable]] attribute of first
      9    updating property are false  (8.12.9 - step Note & 10.a.ii.1)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 Object.defineProperty(obj, "0", {
     17  value: 1001,
     18  writable: false,
     19  configurable: false
     20 });
     21 
     22 Object.defineProperty(obj, "1", {
     23  value: 1003,
     24  writable: false,
     25  configurable: true
     26 });
     27 
     28 try {
     29  Object.defineProperties(obj, {
     30    0: {
     31      value: 1002
     32    },
     33    1: {
     34      value: 1004
     35    }
     36  });
     37 
     38  throw new Test262Error("Expected an exception.");
     39 } catch (e) {
     40  if (!(e instanceof TypeError)) {
     41    throw new Test262Error("Expected TypeError, got " + e);
     42  }
     43 }
     44 
     45 verifyProperty(obj, "0", {
     46  value: 1001,
     47  writable: false,
     48  enumerable: false,
     49  configurable: false,
     50 });
     51 
     52 verifyProperty(obj, "1", {
     53  value: 1003,
     54  writable: false,
     55  enumerable: false,
     56  configurable: true,
     57 });
     58 
     59 reportCompare(0, 0);