summaryrefslogtreecommitdiff
path: root/testdata/012_async.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-26 15:21:15 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-26 15:21:17 -0400
commit7609df9d4f39dec83c633c23833ab8dfd8103ec1 (patch)
tree5e5ae82d2aa6e28d820f1ba76d617b5c1b828a5e /testdata/012_async.ts
parentcbfb7d872009f302b69a55693b5c1fbdc731be69 (diff)
Support async/await by including ES2017
This required adjusting the module loading system.
Diffstat (limited to 'testdata/012_async.ts')
-rw-r--r--testdata/012_async.ts11
1 files changed, 11 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();