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-4.js (737B)


      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-4
      6 description: >
      7    Object.defineProperties - 'P' is own data property that overrides
      8    an inherited accessor property (8.12.9 step 1 )
      9 ---*/
     10 
     11 var proto = {};
     12 Object.defineProperty(proto, "prop", {
     13  get: function() {
     14    return 11;
     15  },
     16  configurable: true
     17 });
     18 var Con = function() {};
     19 Con.prototype = proto;
     20 
     21 var obj = new Con();
     22 Object.defineProperty(obj, "prop", {
     23  value: 12,
     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 
     35 reportCompare(0, 0);