tor-browser

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

15.2.3.6-4-288.js (1047B)


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