Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
138 lines (131 loc) · 3.08 KB

File metadata and controls

138 lines (131 loc) · 3.08 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
/*
*******************************UNIT TEST FOR SWITCH CASE OPTIMIZATION*******************************
* Test with switch expressions as math exp.
* Contains 3 switch cases
*/
function f(x)
{
switch(x++) // post increment
{
case 1:
WScript.Echo(1);
break;
case 2:
WScript.Echo(2);
break;
case 3:
WScript.Echo(3);
break;
case 4:
WScript.Echo(4);
break;
case 5:
WScript.Echo(5);
break;
case 6:
WScript.Echo(6);
break;
case 7:
WScript.Echo(7);
break;
case 8:
WScript.Echo(8);
break;
case 9:
WScript.Echo(9);
break;
case 10:
WScript.Echo(10);
break;
default:
WScript.Echo('default');
break;
}
switch(++x) //pre increment
{
case 1:
WScript.Echo(1);
break;
case 2:
WScript.Echo(2);
break;
case 3:
WScript.Echo(3);
break;
case 4:
WScript.Echo(4);
break;
case 5:
WScript.Echo(5);
break;
case 6:
WScript.Echo(6);
break;
case 7:
WScript.Echo(7);
break;
case 8:
WScript.Echo(8);
break;
case 9:
WScript.Echo(9);
break;
case 10:
WScript.Echo(10);
break;
default:
WScript.Echo('default');
break;
}
switch(x+10) //math expression - adds 10 to x
{
case 11:
WScript.Echo(11);
break;
case 12:
WScript.Echo(12);
break;
case 13:
WScript.Echo(13);
break;
case 14:
WScript.Echo(14);
break;
case 15:
WScript.Echo(15);
break;
case 16:
WScript.Echo(16);
break;
case 17:
WScript.Echo(17);
break;
case 18:
WScript.Echo(18);
break;
case 19:
WScript.Echo(19);
break;
case 20:
WScript.Echo(20);
break;
default:
WScript.Echo('default');
break;
}
}
for (i = 1; i <= 11; i++)
{
f(i);
}
//causing bail out to happen
for(i=0;i<200;i++)
{
f(new Object);
f(100);
f(5);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.