From 783533d2e354ad73356d7517b26293e48c10fc17 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 30 Apr 2024 05:43:05 +0900 Subject: FUTURE: remove import assertions support for JavaScript (#23541) Ref #17944, https://github.com/swc-project/swc/issues/8893 TypeScript removes the `assert` keywords in the transpile, so this PR only works for JavaScript files --- tests/testdata/npm/import_json/main.js | 2 +- tests/testdata/run/deno_futures_env.ts | 3 --- tests/testdata/subdir/mod7.js | 2 +- tests/testdata/subdir/mod8.js | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 tests/testdata/run/deno_futures_env.ts (limited to 'tests/testdata') diff --git a/tests/testdata/npm/import_json/main.js b/tests/testdata/npm/import_json/main.js index b752bdef8..ac6cee9a8 100644 --- a/tests/testdata/npm/import_json/main.js +++ b/tests/testdata/npm/import_json/main.js @@ -1,4 +1,4 @@ -import json from "npm:@denotest/binary-package@1/package.json" assert { +import json from "npm:@denotest/binary-package@1/package.json" with { type: "json", }; console.log(json); diff --git a/tests/testdata/run/deno_futures_env.ts b/tests/testdata/run/deno_futures_env.ts deleted file mode 100644 index 21f76e367..000000000 --- a/tests/testdata/run/deno_futures_env.ts +++ /dev/null @@ -1,3 +0,0 @@ -if (typeof window !== "undefined") { - throw new Error("Window global available"); -} diff --git a/tests/testdata/subdir/mod7.js b/tests/testdata/subdir/mod7.js index 2bd4b5eb7..e71ced92e 100644 --- a/tests/testdata/subdir/mod7.js +++ b/tests/testdata/subdir/mod7.js @@ -1,3 +1,3 @@ -import json1 from "./json_1.json" assert { type: "json" }; +import json1 from "./json_1.json" with { type: "json" }; console.log(json1); diff --git a/tests/testdata/subdir/mod8.js b/tests/testdata/subdir/mod8.js index 5bf7a49a8..ed41d992c 100644 --- a/tests/testdata/subdir/mod8.js +++ b/tests/testdata/subdir/mod8.js @@ -1,3 +1,3 @@ -import json3 from "./json_3.json" assert { type: "json" }; +import json3 from "./json_3.json" with { type: "json" }; console.log(json3); -- cgit v1.2.3