tor-browser

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

symbols-omitted.js (768B)


      1 // Copyright (C) 2015 Jordan Harband. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-object.values
      6 description: Object.values does not include Symbol keys.
      7 author: Jordan Harband
      8 features: [Symbol]
      9 ---*/
     10 
     11 var value = {};
     12 var enumSym = Symbol('enum');
     13 var nonEnumSym = Symbol('nonenum');
     14 var symValue = Symbol('value');
     15 
     16 var obj = {
     17  key: symValue
     18 };
     19 obj[enumSym] = value;
     20 Object.defineProperty(obj, nonEnumSym, {
     21  enumerable: false,
     22  value: value
     23 });
     24 
     25 var result = Object.values(obj);
     26 
     27 assert.sameValue(Array.isArray(result), true, 'result is an array');
     28 assert.sameValue(result.length, 1, 'result has 1 item');
     29 
     30 assert.sameValue(result[0], symValue, 'first value is `symValue`');
     31 
     32 reportCompare(0, 0);