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-267.js (970B)


      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-267
      6 description: >
      7    Object.defineProperties - 'O' is an Array, 'P' is generic
      8    property, and 'desc' is accessor descriptor, test 'P' is defined
      9    in 'O' with all correct attribute values (15.4.5.1 step 5)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var arr = [];
     15 
     16 function get_fun() {
     17  return 12;
     18 }
     19 
     20 function set_fun(value) {
     21  arr.setVerifyHelpProp = value;
     22 }
     23 
     24 Object.defineProperties(arr, {
     25  "property": {
     26    get: get_fun,
     27    set: set_fun,
     28    enumerable: true,
     29    configurable: true
     30  }
     31 });
     32 verifyEqualTo(arr, "property", get_fun());
     33 
     34 verifyWritable(arr, "property", "setVerifyHelpProp");
     35 
     36 verifyProperty(arr, "property", {
     37  enumerable: true,
     38  configurable: true,
     39 });
     40 
     41 if (arr.length !== 0) {
     42  throw new Test262Error('Expected arr.length === 0, actually ' + arr.length);
     43 }
     44 
     45 reportCompare(0, 0);