summaryrefslogtreecommitdiff
path: root/cli/tsc/00_typescript.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-09-07 08:09:16 -0500
committerGitHub <noreply@github.com>2023-09-07 09:09:16 -0400
commit3fc19dab47492e06043fc7add28e64693a4eb775 (patch)
tree855e952933662aef37bd20c084901ae0e488b2db /cli/tsc/00_typescript.js
parent01a761f1d4f7ff4943fbf80464a276b434d8a8f7 (diff)
feat: support import attributes (#20342)
Diffstat (limited to 'cli/tsc/00_typescript.js')
-rw-r--r--cli/tsc/00_typescript.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/cli/tsc/00_typescript.js b/cli/tsc/00_typescript.js
index 7ecdddc5d..08e819b90 100644
--- a/cli/tsc/00_typescript.js
+++ b/cli/tsc/00_typescript.js
@@ -33936,7 +33936,8 @@ ${lanes.join("\n")}
}
const moduleSpecifier = parseModuleSpecifier();
let assertClause;
- if (token() === 132 /* AssertKeyword */ && !scanner2.hasPrecedingLineBreak()) {
+ const hasAssertKeyword = token() === 132 /* AssertKeyword */ || token() === 118 /* WithKeyword */;
+ if (hasAssertKeyword && !scanner2.hasPrecedingLineBreak()) {
assertClause = parseAssertClause();
}
parseSemicolon();
@@ -33956,7 +33957,11 @@ ${lanes.join("\n")}
function parseAssertClause(skipAssertKeyword) {
const pos = getNodePos();
if (!skipAssertKeyword) {
- parseExpected(132 /* AssertKeyword */);
+ if (token() === 118 /* WithKeyword */) {
+ parseExpected(118 /* WithKeyword */);
+ } else {
+ parseExpected(132 /* AssertKeyword */);
+ }
}
const openBracePosition = scanner2.getTokenStart();
if (parseExpected(19 /* OpenBraceToken */)) {