tor-browser

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

15.2.3.6-4-430.js (855B)


      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-430
      6 description: >
      7    ES5 Attributes - success to update the accessor property ([[Get]]
      8    is undefined, [[Set]] is undefined, [[Enumerable]] is true,
      9    [[Configurable]] is true) to a data property
     10 ---*/
     11 
     12 var obj = {};
     13 
     14 Object.defineProperty(obj, "prop", {
     15  get: undefined,
     16  set: undefined,
     17  enumerable: true,
     18  configurable: true
     19 });
     20 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
     21 
     22 Object.defineProperty(obj, "prop", {
     23  value: 1001
     24 });
     25 var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
     26 
     27 assert(desc1.hasOwnProperty("get"), 'desc1.hasOwnProperty("get") !== true');
     28 assert(desc2.hasOwnProperty("value"), 'desc2.hasOwnProperty("value") !== true');
     29 
     30 reportCompare(0, 0);