forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(unstable/worker): ensure import permissions are passed (denoland#…
…26101) We only had integration tests for this and not an integration test. Closes denoland#26074
- Loading branch information
Showing
6 changed files
with
47 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tests": { | ||
"allowed": { | ||
"args": "run -A --unstable-worker-options --quiet main.ts", | ||
"output": "1\n" | ||
}, | ||
"denied": { | ||
"args": "run -A --unstable-worker-options --quiet main_denied.ts", | ||
"output": "denied.out", | ||
"exitCode": 1 | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
error: Uncaught (in worker "") (in promise) TypeError: JSR package manifest for '@std/assert' failed to load. Requires import access to "127.0.0.1:4250", run again with the --allow-import flag | ||
await import(specifier); | ||
^ | ||
at async file:///[WILDLINE] | ||
error: Uncaught (in promise) Error: Unhandled error in child worker. | ||
at [WILDLINE] | ||
at [WILDLINE] |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
new Worker(import.meta.resolve("./worker.ts"), { | ||
type: "module", | ||
deno: { | ||
permissions: { | ||
import: ["127.0.0.1:4250"], | ||
}, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
new Worker(import.meta.resolve("./worker.ts"), { | ||
type: "module", | ||
deno: { | ||
permissions: { | ||
import: [], | ||
}, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const specifier = "jsr:@std/assert/assert"; | ||
await import(specifier); | ||
console.log(1); | ||
close(); |