forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.js
More file actions
51 lines (45 loc) · 1.36 KB
/
try.js
File metadata and controls
51 lines (45 loc) · 1.36 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var e = 8;
function x() { throw 7; }
function y() {
var i;
for (i = 0; i < 10; i++) {
try {
if (i % 2 == 0) {
try {
x();
}
catch (e) {
telemetryLog(`Inner catch: ${e}`, true);
if (i % 3) {
throw e;
}
if (i % 5) {
return e;
}
}
finally {
telemetryLog(`Finally: ${i}`, true);
continue;
}
}
}
catch (e) {
telemetryLog(`Outer catch: ${e}`, true);
}
finally {
telemetryLog(`Outer finally: ${i}`, true);
if (++i % 9 == 0)
return e;
}
}
}
WScript.SetTimeout(testFunction, 50);
/////////////////
function testFunction()
{
y();
}