tor-browser

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

15.2.3.3-3-4.js (761B)


      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.3-3-4
      6 description: >
      7    Object.getOwnPropertyDescriptor - 'P' is own data property that
      8    overrides an inherited accessor property
      9 ---*/
     10 
     11 var proto = {};
     12 Object.defineProperty(proto, "property", {
     13  get: function() {
     14    return "inheritedDataProperty";
     15  },
     16  configurable: true
     17 });
     18 
     19 var Con = function() {};
     20 Con.ptototype = proto;
     21 
     22 var child = new Con();
     23 Object.defineProperty(child, "property", {
     24  value: "ownDataProperty",
     25  configurable: true
     26 });
     27 
     28 var desc = Object.getOwnPropertyDescriptor(child, "property");
     29 
     30 assert.sameValue(desc.value, "ownDataProperty", 'desc.value');
     31 
     32 reportCompare(0, 0);