tor-browser

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

15.2.3.6-4-109.js (838B)


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