summaryrefslogtreecommitdiff
path: root/cli/tsc
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
parent01a761f1d4f7ff4943fbf80464a276b434d8a8f7 (diff)
feat: support import attributes (#20342)
Diffstat (limited to 'cli/tsc')
-rw-r--r--cli/tsc/00_typescript.js9
-rw-r--r--cli/tsc/dts/lib.es5.d.ts1
-rw-r--r--cli/tsc/mod.rs1
3 files changed, 9 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 */)) {
diff --git a/cli/tsc/dts/lib.es5.d.ts b/cli/tsc/dts/lib.es5.d.ts
index 870d8a04c..a723d2942 100644
--- a/cli/tsc/dts/lib.es5.d.ts
+++ b/cli/tsc/dts/lib.es5.d.ts
@@ -639,6 +639,7 @@ interface ImportMeta {
*/
interface ImportCallOptions {
assert?: ImportAssertions;
+ with?: ImportAssertions;
}
/**
diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs
index cfc9bd952..22f9d3290 100644
--- a/cli/tsc/mod.rs
+++ b/cli/tsc/mod.rs
@@ -870,6 +870,7 @@ mod tests {
&mut self,
specifier: &ModuleSpecifier,
_is_dynamic: bool,
+ _cache_setting: deno_graph::source::CacheSetting,
) -> deno_graph::source::LoadFuture {
let specifier_text = specifier
.to_string()