tor-browser

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

object-seal-p-is-own-data-property-that-overrides-an-inherited-data-property.js (654B)


      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 esid: sec-setintegritylevel
      6 description: >
      7    Object.seal - 'P' is own data property that overrides an inherited
      8    data property
      9 includes: [propertyHelper.js]
     10 ---*/
     11 
     12 var proto = {
     13  foo: 0
     14 };
     15 
     16 var ConstructFun = function() {};
     17 ConstructFun.prototype = proto;
     18 
     19 var obj = new ConstructFun();
     20 Object.defineProperty(obj, "foo", {
     21  value: 10,
     22  configurable: true
     23 });
     24 
     25 assert(Object.isExtensible(obj));
     26 Object.seal(obj);
     27 
     28 verifyProperty(obj, "foo", {
     29  value: 10,
     30  configurable: false,
     31 });
     32 
     33 reportCompare(0, 0);