-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathasync.js
32 lines (28 loc) · 902 Bytes
/
async.js
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function foo() {
return this.x; /**bp:locals(1);stack()**/
}
async function af1(a) {
await a;
return await foo.call({ x : 100 }); /**bp:locals();stack()**/
}
async function af2() {
return await af1(10);
}
var p = af2();/**bp:
resume('step_into');stack();
resume('step_into');stack();
resume('step_into');stack();
**/
p.then(result => {
if (result === 100) {
print("PASS");
}
},
error => {
print("Failed : " + error);
}
);