tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

15.2.3.6-4-115.js (949B)


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