tor-browser

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

15.2.3.6-4-281.js (926B)


      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-281
      6 description: >
      7    Object.defineProperty - 'O' is an Array, 'name' is generic own
      8    data property of 'O', test TypeError is thrown when updating the
      9    [[Value]] attribute value of 'name' which is defined as
     10    non-writable and non-configurable (15.4.5.1 step 5)
     11 includes: [propertyHelper.js]
     12 ---*/
     13 
     14 
     15 var arrObj = [];
     16 
     17 Object.defineProperty(arrObj, "property", {
     18  value: 12
     19 });
     20 try {
     21  Object.defineProperty(arrObj, "property", {
     22    value: 36
     23  });
     24  throw new Test262Error("Expected an exception.");
     25 } catch (e) {
     26  if (!(e instanceof TypeError)) {
     27    throw new Test262Error("Expected TypeError, got " + e);
     28  }
     29 }
     30 
     31 verifyProperty(arrObj, "property", {
     32  value: 12,
     33  writable: false,
     34  enumerable: false,
     35  configurable: false,
     36 });
     37 
     38 reportCompare(0, 0);