summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-09-30 12:38:23 -0400
committerGitHub <noreply@github.com>2019-09-30 12:38:23 -0400
commitae26a9c7a22bf3311648a93a3171f087490c6e4d (patch)
tree8a2a4c9264cc842579375d47b915b15456845eca /js
parent5f7ab4884c4009943c1ede3343ab03750ea4a9e1 (diff)
Support top-level-await in TypeScript (#3024)
Diffstat (limited to 'js')
-rw-r--r--js/compiler.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/compiler.ts b/js/compiler.ts
index 1e1fe3dd3..56804ef9f 100644
--- a/js/compiler.ts
+++ b/js/compiler.ts
@@ -539,6 +539,9 @@ window.compilerMain = function compilerMain(): void {
diagnostics = ts.getPreEmitDiagnostics(program).filter(
({ code }): boolean => {
+ // TS1308: 'await' expression is only allowed within an async
+ // function.
+ if (code === 1308) return false;
// TS2691: An import path cannot end with a '.ts' extension. Consider
// importing 'bad-module' instead.
if (code === 2691) return false;