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-304.js (1185B)


      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-304
      6 description: >
      7    Object.defineProperties - 'O' is an Arguments object, 'P' is
      8    generic own accessor property of 'O', and 'desc' is accessor
      9    descriptor, test updating multiple attribute values of 'P' (10.6
     10    [[DefineOwnProperty]] step 4)
     11 includes: [propertyHelper.js]
     12 ---*/
     13 
     14 var arg = (function() {
     15  return arguments;
     16 }(1, 2, 3));
     17 
     18 Object.defineProperty(arg, "genericProperty", {
     19  get: function() {
     20    return 1001;
     21  },
     22  set: function(value) {
     23    arg.testGetFunction1 = value;
     24  },
     25  enumerable: true,
     26  configurable: true
     27 });
     28 
     29 function getFun() {
     30  return "getFunctionString";
     31 }
     32 
     33 function setFun(value) {
     34  arg.testGetFunction = value;
     35 }
     36 Object.defineProperties(arg, {
     37  "genericProperty": {
     38    get: getFun,
     39    set: setFun,
     40    enumerable: false,
     41    configurable: false
     42  }
     43 });
     44 
     45 verifyEqualTo(arg, "genericProperty", getFun());
     46 
     47 verifyWritable(arg, "genericProperty", "testGetFunction");
     48 
     49 verifyProperty(arg, "genericProperty", {
     50  enumerable: false,
     51  configurable: false,
     52 });
     53 
     54 reportCompare(0, 0);