-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stringify specifier synchronously in case of dynamic specifier
- Loading branch information
1 parent
c48d8ca
commit 03e32f7
Showing
5 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
let promise = Promise.resolve().then(() => typeof process === "object" && process.versions.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve(getSpecifier())))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve(getSpecifier())))); | ||
let promise = Promise.resolve(`${getSpecifier()}`).then(s => typeof process === "object" && process.versions.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve(s)))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve(s)))); |
2 changes: 1 addition & 1 deletion
2
...l-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
let promise = Promise.resolve().then(() => WebAssembly.compileStreaming(fetch(import.meta.resolve(getSpecifier())))); | ||
let promise = Promise.resolve(`${getSpecifier()}`).then(s => WebAssembly.compileStreaming(fetch(import.meta.resolve(s)))); |
2 changes: 1 addition & 1 deletion
2
...l-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"use strict"; | ||
|
||
let promise = Promise.resolve().then(() => require("fs").promises.readFile(require.resolve(getSpecifier())).then(WebAssembly.compile)); | ||
let promise = Promise.resolve(`${getSpecifier()}`).then(s => require("fs").promises.readFile(require.resolve(s)).then(WebAssembly.compile)); |
2 changes: 1 addition & 1 deletion
2
...-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import { promises as _promises } from "fs"; | ||
let promise = Promise.resolve().then(() => _promises.readFile(new URL(import.meta.resolve(getSpecifier()))).then(WebAssembly.compile)); | ||
let promise = Promise.resolve(`${getSpecifier()}`).then(s => _promises.readFile(new URL(import.meta.resolve(s))).then(WebAssembly.compile)); |