tor-browser

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

15.2.3.7-5-a-1.js (801B)


      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.7-5-a-1
      6 description: >
      7    Object.defineProperties - 'P' is own data property that overrides
      8    enumerable inherited data property of 'Properties' is defined in
      9    'O'
     10 ---*/
     11 
     12 var obj = {};
     13 
     14 var proto = {};
     15 
     16 Object.defineProperty(proto, "prop", {
     17  value: {
     18    value: 9
     19  },
     20  enumerable: true
     21 });
     22 
     23 var Con = function() {};
     24 Con.prototype = proto;
     25 
     26 var child = new Con();
     27 Object.defineProperty(child, "prop", {
     28  value: {
     29    value: 12
     30  },
     31  enumerable: true
     32 });
     33 
     34 Object.defineProperties(obj, child);
     35 
     36 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
     37 assert.sameValue(obj.prop, 12, 'obj.prop');
     38 
     39 reportCompare(0, 0);