tor-browser

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

var-env-var-init-global-new.js (1008B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-evaldeclarationinstantiation
      5 description: Initialization of new global property
      6 info: |
      7    [...]
      8    16. For each String vn in declaredVarNames, in list order do
      9        a. If varEnvRec is a global Environment Record, then
     10           i. Perform ? varEnvRec.CreateGlobalVarBinding(vn, true).
     11    [...]
     12 
     13    8.1.1.4.17 CreateGlobalVarBinding
     14 
     15    [...]
     16    5. Let extensible be ? IsExtensible(globalObject).
     17    6. If hasProperty is false and extensible is true, then
     18       a. Perform ? ObjRec.CreateMutableBinding(N, D).
     19       b. Perform ? ObjRec.InitializeBinding(N, undefined).
     20    [...]
     21 includes: [propertyHelper.js]
     22 ---*/
     23 
     24 var initial = null;
     25 
     26 (0, eval)('initial = x; var x = 9;');
     27 
     28 verifyProperty(this, 'x', {
     29  value: 9,
     30  writable: true,
     31  enumerable: true,
     32  configurable: true,
     33 });
     34 
     35 assert.sameValue(initial, undefined);
     36 
     37 reportCompare(0, 0);