tor-browser

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

lookup-from-closure.js (580B)


      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    lookup from closure
      7 ---*/
      8 function f5(one) {
      9  var x = one + 1;
     10  let y = one + 2;
     11  const u = one + 4;
     12  {
     13    let z = one + 3;
     14    const v = one + 5;
     15    function f() {
     16      assert.sameValue(one, 1);
     17      assert.sameValue(x, 2);
     18      assert.sameValue(y, 3);
     19      assert.sameValue(z, 4);
     20      assert.sameValue(u, 5);
     21      assert.sameValue(v, 6);
     22    }
     23 
     24    f();
     25  }
     26 }
     27 f5(1);
     28 
     29 
     30 reportCompare(0, 0);