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-205.js (1004B)


      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-205
      6 description: >
      7    Object.defineProperties - 'O' is an Array, 'P' is an array index
      8    named property, 'desc' is accessor descriptor, test updating all
      9    attribute values of 'P'  (15.4.5.1 step 4.c)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 var arr = [];
     14 
     15 Object.defineProperties(arr, {
     16  "0": {
     17    get: function() {
     18      return 11;
     19    },
     20    set: function() {},
     21    configurable: true,
     22    enumerable: true
     23  }
     24 });
     25 
     26 var setFun = function(value) {
     27  arr.setVerifyHelpProp = value;
     28 };
     29 var getFun = function() {
     30  return 14;
     31 };
     32 Object.defineProperties(arr, {
     33  "0": {
     34    get: getFun,
     35    set: setFun,
     36    configurable: false,
     37    enumerable: false
     38  }
     39 });
     40 
     41 verifyEqualTo(arr, "0", getFun());
     42 
     43 verifyWritable(arr, "0", "setVerifyHelpProp");
     44 
     45 verifyProperty(arr, "0", {
     46  enumerable: false,
     47  configurable: false,
     48 });
     49 
     50 reportCompare(0, 0);