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-101.js (889B)


      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-101
      6 description: >
      7    Object.defineProperties - 'P' is accessor property, both
      8    properties.[[Get]] and P.[[Get]] are two different values (8.12.9
      9    step 12)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 
     14 var obj = {};
     15 
     16 function get_func() {
     17  return 10;
     18 }
     19 
     20 function set_func(value) {
     21  obj.setVerifyHelpProp = value;
     22 }
     23 
     24 Object.defineProperty(obj, "foo", {
     25  get: get_func,
     26  set: set_func,
     27  enumerable: true,
     28  configurable: true
     29 });
     30 
     31 function get_func2() {
     32  return 20;
     33 }
     34 
     35 Object.defineProperties(obj, {
     36  foo: {
     37    get: get_func2
     38  }
     39 });
     40 verifyEqualTo(obj, "foo", get_func2());
     41 
     42 verifyWritable(obj, "foo", "setVerifyHelpProp");
     43 
     44 verifyProperty(obj, "foo", {
     45  enumerable: true,
     46  configurable: true,
     47 });
     48 
     49 reportCompare(0, 0);