tor-browser

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

block-decl-eval-source-is-strict-nostrict.js (635B)


      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-web-compat-evaldeclarationinstantiation
      5 description: >
      6    AnnexB extension not honored in strict mode, Block statement
      7    in eval code containing a function declaration
      8 info: |
      9    B.3.3.3 Changes to EvalDeclarationInstantiation
     10 
     11    1. If strict is false, then
     12      ...
     13 
     14 flags: [noStrict]
     15 ---*/
     16 
     17 var err;
     18 
     19 eval('"use strict";{ function f() {} }');
     20 
     21 try {
     22  f;
     23 } catch (exception) {
     24  err = exception;
     25 }
     26 
     27 assert.sameValue(err.constructor, ReferenceError);
     28 
     29 reportCompare(0, 0);