forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlet_stackfunc.js
More file actions
37 lines (30 loc) · 967 Bytes
/
let_stackfunc.js
File metadata and controls
37 lines (30 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var x = "glo";
function test(yes, param)
{
function nested() { return param + x; }
if (yes)
{
let x = nested() + " yes";
let f = function() { WScript.Echo(x); }
f();
}
else
{
for (var i = 0; i < 2; i++)
{
let x;
if ( i == 0) {x = "0"; }
let f2 = function() { WScript.Echo(x); }
let f3 = function() { WScript.Echo("f3" + x); }
f2();
f3();
}
}
}
test(true, "test1");
test(true, "test2");
test(false, "test3");