tor-browser

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

15.2.3.4-4-43.js (695B)


      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.4-4-43
      6 description: >
      7    Object.getOwnPropertyNames - own accessor property of String
      8    object 'O' is pushed into the returned array
      9 ---*/
     10 
     11 var propertyFound = false;
     12 
     13 var str = new String("abc");
     14 
     15 Object.defineProperty(str, "ownProperty", {
     16  get: function() {
     17    return "ownString";
     18  },
     19  configurable: true
     20 });
     21 
     22 var result = Object.getOwnPropertyNames(str);
     23 
     24 for (var p in result) {
     25  if (result[p] === "ownProperty") {
     26    propertyFound = true;
     27    break;
     28  }
     29 }
     30 
     31 assert(propertyFound, 'Property not found');
     32 
     33 reportCompare(0, 0);