tor-browser

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

var-env-var-strict-caller-2-strict.js (503B)


      1 'use strict';
      2 // Copyright (c) 2012 Ecma International.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 es5id: 10.4.2.1-1gs
      7 description: >
      8    Strict Mode - eval code cannot instantiate variable in the
      9    variable environment of the calling context that invoked the eval
     10    if the code of the calling context is strict code
     11 flags: [onlyStrict]
     12 ---*/
     13 
     14 eval("var x = 7;");
     15 assert.throws(ReferenceError, function() {
     16  x = 9;
     17 });
     18 
     19 reportCompare(0, 0);