tor-browser

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

15.2.3.6-4-578.js (709B)


      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-578
      6 description: >
      7    ES5 Attributes - [[Get]] field of inherited property of
      8    [[Prototype]] internal property is correct (String instance)
      9 ---*/
     10 
     11 var data = "data";
     12 
     13 Object.defineProperty(String.prototype, "prop", {
     14  get: function() {
     15    return data;
     16  },
     17  set: function(value) {
     18    data = value;
     19  },
     20  enumerable: true,
     21  configurable: true
     22 });
     23 var strObj = new String();
     24 
     25 assert.sameValue(strObj.hasOwnProperty("prop"), false, 'strObj.hasOwnProperty("prop")');
     26 assert.sameValue(strObj.prop, "data", 'strObj.prop');
     27 
     28 reportCompare(0, 0);