diff options
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/012_async.ts | 11 | ||||
-rw-r--r-- | testdata/012_async.ts.out | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testdata/012_async.ts b/testdata/012_async.ts new file mode 100644 index 000000000..57ae355c2 --- /dev/null +++ b/testdata/012_async.ts @@ -0,0 +1,11 @@ +// Check that we can use the async keyword. +async function main() { + await new Promise((resolve, reject) => { + console.log("2"); + setTimeout(resolve, 100); + }); + console.log("3"); +} + +console.log("1"); +main(); diff --git a/testdata/012_async.ts.out b/testdata/012_async.ts.out new file mode 100644 index 000000000..01e79c32a --- /dev/null +++ b/testdata/012_async.ts.out @@ -0,0 +1,3 @@ +1 +2 +3 |