tor-browser

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

15.2.3.7-6-a-7.js (781B)


      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-6-a-7
      6 description: >
      7    Object.defineProperties - 'P' is own accessor property that
      8    overrides an inherited data property (8.12.9 step 1 )
      9 ---*/
     10 
     11 var proto = {};
     12 Object.defineProperty(proto, "prop", {
     13  value: 11,
     14  configurable: true
     15 });
     16 var Con = function() {};
     17 Con.prototype = proto;
     18 
     19 var obj = new Con();
     20 Object.defineProperty(obj, "prop", {
     21  get: function() {
     22    return 12;
     23  },
     24  configurable: false
     25 });
     26 assert.throws(TypeError, function() {
     27  Object.defineProperties(obj, {
     28    prop: {
     29      value: 13,
     30      configurable: true
     31    }
     32  });
     33 });
     34 assert.sameValue(obj.prop, 12, 'obj.prop');
     35 
     36 reportCompare(0, 0);