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-6.js (925B)


      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-6
      6 description: >
      7    Object.defineProperties - enumerable own accessor property of
      8    'Properties' without a get function that overrides enumerable
      9    inherited accessor property of 'Properties' is defined in 'O'
     10 ---*/
     11 
     12 var obj = {};
     13 
     14 var proto = {};
     15 
     16 Object.defineProperty(proto, "prop", {
     17  get: function() {
     18    return 12;
     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  get: function() {
     29    return {
     30      set: function() {}
     31    };
     32  },
     33  enumerable: true
     34 });
     35 Object.defineProperties(obj, child);
     36 
     37 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
     38 assert.sameValue(typeof obj.prop, "undefined", 'typeof obj.prop');
     39 
     40 reportCompare(0, 0);