tor-browser

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

12.6.4-2.js (947B)


      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: 12.6.4-2
      6 description: >
      7    The for-in Statement - the values of [[Enumerable]] attributes are
      8    not considered when determining if a property of a prototype
      9    object is shadowed by a previous object on the prototype chain
     10 ---*/
     11 
     12        var proto = {
     13            prop: "enumerableValue"
     14        };
     15 
     16        var ConstructFun = function () { };
     17        ConstructFun.prototype = proto;
     18 
     19        var child = new ConstructFun();
     20 
     21        Object.defineProperty(child, "prop", {
     22            value: "nonEnumerableValue",
     23            enumerable: false
     24        });
     25 
     26        var accessedProp = false;
     27 
     28        for (var p in child) {
     29            if (p === "prop") {
     30                accessedProp = true;
     31            }
     32        }
     33 
     34 assert.sameValue(accessedProp, false, 'accessedProp');
     35 
     36 reportCompare(0, 0);