tor-browser

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

15.2.3.6-4-505.js (935B)


      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-505
      6 description: >
      7    ES5 Attributes - property ([[Get]] is a Function, [[Set]] is
      8    undefined, [[Enumerable]] is true, [[Configurable]] is false) is
      9    enumerable
     10 ---*/
     11 
     12 var propertyFound = false;
     13 
     14 var obj = {};
     15 
     16 var getFunc = function() {
     17  return 1001;
     18 };
     19 
     20 Object.defineProperty(obj, "prop", {
     21  get: getFunc,
     22  set: undefined,
     23  enumerable: true,
     24  configurable: false
     25 });
     26 
     27 var propertyDefineCorrect = obj.hasOwnProperty("prop");
     28 var desc = Object.getOwnPropertyDescriptor(obj, "prop");
     29 
     30 for (var p in obj) {
     31  if (p === "prop") {
     32    propertyFound = true;
     33    break;
     34  }
     35 }
     36 
     37 assert(propertyFound, 'Property not found');
     38 assert(propertyDefineCorrect, 'propertyDefineCorrect !== true');
     39 assert.sameValue(desc.enumerable, true, 'desc.enumerable');
     40 
     41 reportCompare(0, 0);