tor-browser

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

strict-caller-global-strict.js (818B)


      1 // |reftest| error:SyntaxError
      2 'use strict';
      3 // Copyright (C) 2020 Leo Balter. All rights reserved.
      4 // This code is governed by the BSD license found in the LICENSE file.
      5 /*---
      6 esid: sec-performeval
      7 description: Script will be script if strictCaller is true
      8 info: |
      9    ...
     10    10. If strictCaller is true, let strictEval be true.
     11    ...
     12    12. Let runningContext be the running execution context.
     13    ...
     14 negative:
     15  phase: runtime
     16  type: SyntaxError
     17 flags: [onlyStrict]
     18 ---*/
     19 
     20 // Although the `try` statement is a more precise mechanism for detecting
     21 // runtime errors, the behavior under test is only observable for a direct eval
     22 // call when the call is made from the global scope. This forces the use of
     23 // the more coarse-grained `negative` frontmatter to assert the expected error.
     24 
     25 eval('var public = 1;');