-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathbox.js
42 lines (36 loc) · 1.01 KB
/
box.js
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
38
39
40
41
42
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var glo;
var box = false;
function test(param)
{
var recurse = 0;
function nested1(param2)
{
function nested2()
{
return param + param2;
}
recurse++;
if (recurse < 10)
{
return nested1(param + param2 + recurse);
}
if (box)
{
escape();
return glo();
}
return nested2();
}
WScript.Echo(nested1());
function blah() { return "blah"; }
function escape() { glo = blah; }
}
test("test1");
test("test2"); // JIT
box = true;
test("test3" )
WScript.Echo(glo());