forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoLoop3.js
More file actions
43 lines (38 loc) · 954 Bytes
/
DoLoop3.js
File metadata and controls
43 lines (38 loc) · 954 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
38
39
40
41
42
43
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var i = 0;
function f()
{
WScript.Echo("condition, i = " + i);
return i < 10;
}
WScript.Echo("--- test 1 ---");
do
{
++i;
if(i > 5)
continue;
WScript.Echo("after continue: " + i++);
} while(f());
i = 0;
WScript.Echo("--- test 2 ---");
do
{
switch(i++)
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
continue;
default:
WScript.Echo("default");
case 9:
break;
}
} while(f());
WScript.Echo("done");