tor-browser

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

object-seal-inherited-accessor-properties-are-ignored.js (823B)


      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: Object.seal - inherited accessor properties are ignored
      7 ---*/
      8 
      9 var proto = {};
     10 
     11 Object.defineProperty(proto, "Father", {
     12  get: function() {
     13    return 10;
     14  },
     15  configurable: true
     16 });
     17 
     18 var ConstructFun = function() {};
     19 ConstructFun.prototype = proto;
     20 
     21 var child = new ConstructFun();
     22 var preCheck = Object.isExtensible(child);
     23 Object.seal(child);
     24 
     25 var beforeDeleted = proto.hasOwnProperty("Father");
     26 delete proto.Father;
     27 var afterDeleted = proto.hasOwnProperty("Father");
     28 
     29 assert(preCheck, 'preCheck !== true');
     30 assert(beforeDeleted, 'beforeDeleted !== true');
     31 assert.sameValue(afterDeleted, false, 'afterDeleted');
     32 
     33 reportCompare(0, 0);