tor-browser

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

let-closure-inside-next-expression.js (394B)


      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    let: closure inside for loop next-expression
      7 ---*/
      8 let a = [];
      9 for (let i = 0; i < 5; a.push(function () { return i; }), ++i) { }
     10 for (let k = 0; k < 5; ++k) {
     11  assert.sameValue(k + 1, a[k]());
     12 }
     13 
     14 reportCompare(0, 0);