tor-browser

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

ident-name-reserved-word-literal-prop-name.js (719B)


      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: 7.6.1-1-1
      6 description: >
      7    Allow reserved words as property names at object initialization.
      8 ---*/
      9 
     10 var tokenCodes = {
     11    null: 'null',
     12    true: 'true',
     13    false: 'false',
     14 };
     15 
     16 var arr = [
     17    'null',
     18    'true',
     19    'false',
     20 ];
     21 
     22 for (var i = 0; i < arr.length; ++i) {
     23    var propertyName = arr[i];
     24 
     25    assert(tokenCodes.hasOwnProperty(propertyName),
     26           'Property "' + propertyName + '" found');
     27 
     28    assert.sameValue(tokenCodes[propertyName], propertyName,
     29                     'Property "' + propertyName + '" has correct value');
     30 }
     31 
     32 reportCompare(0, 0);