forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallbackClear.js
More file actions
38 lines (26 loc) · 1.08 KB
/
Copy pathcallbackClear.js
File metadata and controls
38 lines (26 loc) · 1.08 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
//
//In theory this test could be race-y -- in which case suppress the console printing but in general ch should be well behaved
//
telemetryLog("Start Global Code", true);
var foo1id = undefined;
function foo1()
{
telemetryLog("Start Foo1", true);
WScript.Echo("Hello World - CallBack 1");
telemetryLog("End Foo1", true);
}
function foo2()
{
telemetryLog("Start Foo2", true);
WScript.Echo("Cancel Callback 1 from CallBack 2");
WScript.ClearTimeout(foo1id);
telemetryLog("End Foo2", true);
}
foo1id = WScript.SetTimeout(foo1, 500);
WScript.SetTimeout(foo2, 100);
WScript.Echo("Hello World - Global");
telemetryLog("End Global Code", true);