tor-browser

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

15.2.3.14-5-14.js (686B)


      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.14-5-14
      6 description: >
      7    Object.keys - own enumerable indexed accessor property of sparse
      8    array 'O' is defined in returned array
      9 ---*/
     10 
     11 var propertyFound = false;
     12 
     13 var obj = [1, , 3, , 5];
     14 
     15 Object.defineProperty(obj, "10000", {
     16  get: function() {
     17    return "ElementWithLargeIndex";
     18  },
     19  enumerable: true,
     20  configurable: true
     21 });
     22 
     23 var arr = Object.keys(obj);
     24 
     25 for (var p in arr) {
     26  if (arr[p] === "10000") {
     27    propertyFound = true;
     28    break;
     29  }
     30 }
     31 
     32 assert(propertyFound, 'Property not found');
     33 
     34 reportCompare(0, 0);