From 7609df9d4f39dec83c633c23833ab8dfd8103ec1 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 26 May 2018 15:21:15 -0400 Subject: Support async/await by including ES2017 This required adjusting the module loading system. --- testdata/012_async.ts | 11 +++++++++++ testdata/012_async.ts.out | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 testdata/012_async.ts create mode 100644 testdata/012_async.ts.out (limited to 'testdata') 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 -- cgit v1.2.3