tor-browser

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

15.2.3.5-4-27.js (796B)


      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.5-4-27
      6 description: >
      7    Object.create - own enumerable accessor property in 'Properties'
      8    without a get function that overrides an enumerable inherited
      9    accessor property in 'Properties' is defined in 'obj' (15.2.3.7
     10    step 5.a)
     11 ---*/
     12 
     13 var proto = {};
     14 Object.defineProperty(proto, "prop", {
     15  get: function() {
     16    return {};
     17  },
     18  enumerable: true
     19 });
     20 
     21 var ConstructFun = function() {};
     22 ConstructFun.prototype = proto;
     23 
     24 var child = new ConstructFun();
     25 Object.defineProperty(child, "prop", {
     26  set: function() {},
     27  enumerable: true
     28 });
     29 assert.throws(TypeError, function() {
     30  Object.create({}, child);
     31 });
     32 
     33 reportCompare(0, 0);