tor-browser

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

block-decl-nostrict.js (758B)


      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-functiondeclarationinstantiation
      5 description: >
      6    AnnexB extension not honored in strict mode, Block statement
      7    in function code containing a function declaration
      8 info: |
      9    B.3.3.1 Changes to FunctionDeclarationInstantiation
     10 
     11    1. If strict is false, then
     12      ...
     13 
     14 flags: [noStrict]
     15 ---*/
     16 
     17 var err1, err2;
     18 
     19 (function() {
     20  try {
     21    f;
     22  } catch (exception) {
     23    err1 = exception;
     24  }
     25 
     26  {
     27    function f() {  }
     28  }
     29 
     30  try {
     31    f;
     32  } catch (exception) {
     33    err2 = exception;
     34  }
     35 }());
     36 
     37 assert.sameValue(err1, undefined);
     38 assert.sameValue(err2, undefined);
     39 
     40 reportCompare(0, 0);