tor-browser

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

15.2.3.6-4-82-7.js (1112B)


      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-82-7
      6 description: >
      7    Object.defineProperty - Update [[Enumerable]] attribute of 'name'
      8    property to false successfully when [[Enumerable]] and
      9    [[Configurable]] attributes of 'name' property are true,  the
     10    'desc' is a generic descriptor which only contains [Enumerable]]
     11    attribute as false and 'name' property is an accessor property
     12    (8.12.9 step 8)
     13 includes: [propertyHelper.js]
     14 ---*/
     15 
     16 
     17 var obj = {};
     18 obj.verifySetFunction = "data";
     19 var get_func = function() {
     20  return obj.verifySetFunction;
     21 };
     22 var set_func = function(value) {
     23  obj.verifySetFunction = value;
     24 };
     25 Object.defineProperty(obj, "foo", {
     26  get: get_func,
     27  set: set_func,
     28  enumerable: true,
     29  configurable: true
     30 });
     31 
     32 Object.defineProperty(obj, "foo", {
     33  enumerable: false
     34 });
     35 
     36 verifyEqualTo(obj, "foo", get_func());
     37 
     38 verifyWritable(obj, "foo", "verifySetFunction");
     39 
     40 verifyProperty(obj, "foo", {
     41  enumerable: false,
     42  configurable: true,
     43 });
     44 
     45 reportCompare(0, 0);