tor-browser

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

outermost-binding-updated-in-catch-block-nested-block-let-declaration-unseen-outside-of-block.js (760B)


      1 // Copyright (C) 2011 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 13.1
      5 description: >
      6    outermost binding updated in catch block; nested block let declaration unseen outside of block
      7 ---*/
      8 var caught = false;
      9 try {
     10  {
     11    let xx = 18;
     12    throw 25;
     13  }
     14 } catch (e) {
     15  caught = true;
     16  assert.sameValue(e, 25);
     17  (function () {
     18    try {
     19      // NOTE: This checks that the block scope containing xx has been
     20      // removed from the context chain.
     21      assert.sameValue(xx, undefined);
     22      eval('xx');
     23      assert(false);  // should not reach here
     24    } catch (e2) {
     25      assert(e2 instanceof ReferenceError);
     26    }
     27  })();
     28 }
     29 assert(caught);
     30 
     31 
     32 reportCompare(0, 0);