Debian Codegraph @

rhino/testsrc/tests/js1_8_1/regress/regress-495907.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-495907.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 495907;
9 var summary = 'Read upvar from trace-entry frame when created with top-level let';
10 var actual = ''
11 var expect = '00112233';
12 //-----------------------------------------------------------------------------
13
14 // The test code needs to run at top level in order to expose the bug.
15 start_test();
16
17 var o = [];
18 for (let a = 0; a < 4; ++a) {
19 (function () {for (var b = 0; b < 2; ++b) {o.push(a);}}());
20 }
21 actual = o.join("");
22
23 finish_test();
24 //-----------------------------------------------------------------------------
25
26 function start_test() {
27 enterFunc ('test');
28 printBugNumber(BUGNUMBER);
29 printStatus (summary);
30 jit(true);
31 }
32
33 function finish_test() {
34 jit(false);
35 reportCompare(expect, actual, summary);
36 exitFunc ('test');
37 }