tor-browser

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

always-non-strict-strict.js (745B)


      1 'use strict';
      2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 description: Strictness of direct eval is not dependent on strictness of caller
      6 esid: sec-strict-mode-code
      7 info: |
      8    Eval code is strict mode code if it begins with a Directive Prologue that
      9    contains a Use Strict Directive or if the call to eval is a direct eval
     10    that is contained in strict mode code.
     11 flags: [onlyStrict]
     12 ---*/
     13 
     14 var count = 0;
     15 
     16 (0,eval)('var static; count += 1;');
     17 
     18 assert.sameValue(count, 1);
     19 
     20 (0,eval)('with ({}) {} count += 1;');
     21 
     22 assert.sameValue(count, 2);
     23 
     24 (0,eval)('unresolvable = null; count += 1;');
     25 
     26 assert.sameValue(count, 3);
     27 
     28 reportCompare(0, 0);