tor-browser

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

15.2.3.6-4-468.js (941B)


      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-468
      6 description: >
      7    ES5 Attributes - [[Set]] attribute of accessor property ([[Get]]
      8    is undefined, [[Set]] is a Function, [[Enumerable]] is true,
      9    [[Configurable]] is false) is the expected function
     10 ---*/
     11 
     12 var obj = {};
     13 
     14 var verifySetFunc = "data";
     15 var setFunc = function(value) {
     16  verifySetFunc = value;
     17 };
     18 
     19 Object.defineProperty(obj, "prop", {
     20  get: undefined,
     21  set: setFunc,
     22  enumerable: true,
     23  configurable: false
     24 });
     25 
     26 obj.prop = "overrideData";
     27 var propertyDefineCorrect = obj.hasOwnProperty("prop");
     28 var desc = Object.getOwnPropertyDescriptor(obj, "prop");
     29 
     30 assert(propertyDefineCorrect, 'propertyDefineCorrect !== true');
     31 assert.sameValue(desc.set, setFunc, 'desc.set');
     32 assert.sameValue(verifySetFunc, "overrideData", 'verifySetFunc');
     33 
     34 reportCompare(0, 0);