tor-browser

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

10.1.1-11-s.js (741B)


      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: 10.1.1-11-s
      6 description: >
      7    Strict Mode - Eval code is strict code with a Use Strict Directive
      8    at the beginning of the block
      9 flags: [noStrict]
     10 ---*/
     11 
     12 var err = null;
     13 
     14        try {
     15            eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;");
     16        } catch (e) {
     17            err = e;
     18        }
     19 
     20 assert(err instanceof SyntaxError, 'err instanceof SyntaxError');
     21 assert.sameValue(typeof public, "undefined", 'typeof public');
     22 assert.sameValue(typeof anotherVariableNotReserveWord, "undefined", 'typeof anotherVariableNotReserveWord');
     23 
     24 reportCompare(0, 0);