tor-browser

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

15.2.3.6-4-25.js (753B)


      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.6-4-25
      6 description: >
      7    Object.defineProperty - 'data' 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, "foo", {
     13  get: function() {},
     14  configurable: true
     15 });
     16 
     17 var ConstructFun = function() {};
     18 ConstructFun.prototype = proto;
     19 var obj = new ConstructFun();
     20 Object.defineProperty(obj, "foo", {
     21  value: 11,
     22  configurable: false
     23 });
     24 assert.throws(TypeError, function() {
     25  Object.defineProperty(obj, "foo", {
     26    configurable: true
     27  });
     28 });
     29 assert.sameValue(obj.foo, 11, 'obj.foo');
     30 
     31 reportCompare(0, 0);