Bug 1914261 - Rename --noinstall to --no-install for raptor. r=perftest-reviewers...
[gecko.git] / js / src / tests / non262 / regress / regress-369666-02.js
blobb8e2dfb74f1f5f3118a27ad994499ef2d7c3f75a
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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/. */
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 369666;
8 var summary = 'inner function declaration in let-induced outer ' +
9   'function body gets wrong scope.';
10 var actual = 'No Crash';
11 var expect = 'No Crash';
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
18 function test()
20   printBugNumber(BUGNUMBER);
21   printStatus (summary);
23   function foo() {
24     let x = 42
26       function bar() {
27       return x;
28     }
30     return bar;
31   }
33   print(foo()());
35   baz = false;
37   function foo2() {
38     let x = 42
40       function bar() {
41       return x;
42     }
44     function bletch() {
45       return x * x;
46     }
48     try {
49       if (baz)
50         return bar;
51     } finally {
52       print('finally', x);
53     }
54     return bletch;
55   }
57   print(foo2()());
59   reportCompare(expect, actual, summary);