tor-browser

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

13.2-17-1.js (976B)


      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: 13.2-17-1
      6 description: >
      7    Function Object has 'constructor' as its own property, it is not
      8    enumerable and does not invoke the setter defined on
      9    Function.prototype.constructor (Step 17)
     10 includes: [propertyHelper.js]
     11 ---*/
     12 
     13 var desc = Object.getOwnPropertyDescriptor(Object.prototype, "constructor");
     14 
     15 var getFunc = function () {
     16    return 100;
     17 };
     18 
     19 var data = "data";
     20 var setFunc = function (value) {
     21    data = value;
     22 };
     23 
     24 Object.defineProperty(Object.prototype, "constructor", {
     25    get: getFunc,
     26    set: setFunc,
     27    configurable: true
     28 });
     29 
     30 var fun = function () {};
     31 
     32 assert.sameValue(typeof fun.prototype.constructor, "function");
     33 
     34 verifyProperty(fun.prototype, "constructor", {
     35    writable: true,
     36    enumerable: false,
     37    configurable: true,
     38 });
     39 
     40 assert.sameValue(data, "data", 'data');
     41 
     42 reportCompare(0, 0);