tor-browser

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

15.2.3.6-4-114.js (842B)


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