Debian Codegraph @

rhino/testsrc/tests/js1_7/block/regress-344262.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-344262.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 344262;
9 var summary = 'Variables bound by let statement/expression';
10 var actual = '';
11 var expect = 0;
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 function f() {
25 var a = [];
26 for (var i = 0; i < 10; i++) {
27 a[i] = let (j = i) function () { return j; };
28 var b = [];
29 for (var k = 0; k <= i; k++)
30 b.push(a[k]());
31 print(b.join());
32 }
33 actual = a[0]();
34 print(actual);
35 }
36 f();
37
38 reportCompare(expect, actual, summary);
39
40 exitFunc ('test');
41 }