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-109.js (942B)


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