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: static import permissions in dynamic imports
Co-authored-by: Bartek Iwańczuk <[email protected]>
- Loading branch information
1 parent
910935c
commit 5151afa
Showing
39 changed files
with
271 additions
and
65 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
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
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
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
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 @@ | ||
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. | ||
const code = `import "file:https:///local_file.ts";`; | ||
const blob = new Blob([code]); | ||
await import(URL.createObjectURL(blob)); |
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,5 @@ | ||
error: Uncaught (in promise) TypeError: Requires read access to "/local_file.ts", run again with the --allow-read flag | ||
at blob:null/[WILDCARD]:1:0 | ||
await import(URL.createObjectURL(blob)); | ||
^ | ||
at async file:https:///[WILDCARD]/cli/tests/dynamic_import/permissions_blob_local.ts:4: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,4 @@ | ||
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. | ||
const code = `import "https://example.com/some/file.ts";`; | ||
const blob = new Blob([code]); | ||
await import(URL.createObjectURL(blob)); |
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,5 @@ | ||
error: Uncaught (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag | ||
at blob:null/[WILDCARD]:1:0 | ||
await import(URL.createObjectURL(blob)); | ||
^ | ||
at async file:https:///[WILDCARD]/cli/tests/dynamic_import/permissions_blob_remote.ts:4: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,3 @@ | ||
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. | ||
const code = `import "file:https:///local_file.ts";`; | ||
await import(`data:application/javascript;base64,${btoa(code)}`); |
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,5 @@ | ||
error: Uncaught (in promise) TypeError: Requires read access to "/local_file.ts", run again with the --allow-read flag | ||
at data:application/javascript;base64,aW1wb3J0ICJmaWxlOi8vL2xvY2FsX2ZpbGUudHMiOw==:1:0 | ||
await import(`data:application/javascript;base64,${btoa(code)}`); | ||
^ | ||
at async file:https:///[WILDCARD]/cli/tests/dynamic_import/permissions_data_local.ts:3: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,3 @@ | ||
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. | ||
const code = `import "https://example.com/some/file.ts";`; | ||
await import(`data:application/javascript;base64,${btoa(code)}`); |
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,5 @@ | ||
error: Uncaught (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag | ||
at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:0 | ||
await import(`data:application/javascript;base64,${btoa(code)}`); | ||
^ | ||
at async file:https:///[WILDCARD]/cli/tests/dynamic_import/permissions_data_remote.ts:3: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,3 @@ | ||
await import( | ||
"http:https://localhost:4545/cli/tests/dynamic_import/static_remote.ts" | ||
); |
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,5 @@ | ||
error: Uncaught (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag | ||
at http:https://localhost:4545/cli/tests/dynamic_import/static_remote.ts:2:0 | ||
await import( | ||
^ | ||
at async file:https:///[WILDCARD]/cli/tests/dynamic_import/permissions_remote_remote.ts:1: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,2 @@ | ||
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. | ||
import "https://example.com/some/file.ts"; |
Oops, something went wrong.