blob: 65190258223df49692414be1792ea93ba90e15ee (
plain) (
blame)
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
|
promise 1 constructed, but won't be resolved immediately
promise 3 constructed
promise 4 constructed
promise 5 constructed
promsie 8 will never be resolved
calling t4: resolve promise 3
calling t5: resolve promise 4
calling t3: resolve promise 5
promise 3, 4, 5 resolved with 1, 1.50, "hello world"
calling t1: resolve first half of promise 1
got resolved x = 10, output x + 42
got resolved x = 52, output x * 2
get resolved x = 104, promise 2 constructed, not resolved, will be resolved with a string instead
calling t2: resolve the second half of promise 1 (promise 2)
got string from promise 2: "promise 2 resolved", output 11
got resolved x = 11, output 12
plain function f resolved with 12
operator A got 13
operator B got 14
plain function g resolved with 15
operator A got 1
void return is ok
void parameter is ok
void parameter will ignore the returned value
promise 1, 6 resolved 100
promise 9 resolved with 101
rejecting with value -1
reason: -1
reason: 0
fac(10) = 3628800
|