forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForInInline.js
More file actions
54 lines (47 loc) · 1.44 KB
/
ForInInline.js
File metadata and controls
54 lines (47 loc) · 1.44 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var obj = { a: 1, b: 2, c:3 };
var obj2 = { d: 1, e: 2, f:3 };
var obj3 = { g: 1, h: 2, i:3 };
var obj4 = { j: 1, k: 2, l:3 };
var inlinee = function() { return ""; };
function func(obj, obj2, obj3, obj4)
{
for (var s in obj) {
WScript.Echo("outter " + s);
forin_inlinee(obj2, obj3);
}
forin4(obj, obj2, obj3, obj4);
}
function forin_inlinee(obj2, obj3)
{
for (var s in obj2) {
WScript.Echo("inner " + s);
forin_inlinee2(obj3);
}
}
function forin_inlinee2(obj3)
{
for (var s in obj3) {
WScript.Echo("inner3 " + s);
}
}
function forin4(obj, obj2, obj3, obj4)
{
for (var s in obj) {
for (var s1 in obj2) {
for (var s2 in obj3) {
for (var s3 in obj4) {
WScript.Echo(inlinee() + s + s1 + s2 + s3);
}
}
}
}
}
func(obj, obj2, obj3, obj4);
func(obj, obj2, obj3, obj4);
func(obj, obj2, obj3, obj4);
inlinee = function() { return " "; } // force a bailout
func(obj, obj2, obj3, obj4);