feat(cli): don't check permissions for statically analyzable dynamic imports (#18713)

Closes #17697
Closes #17658
This commit is contained in:
Nayeem Rahman 2023-04-26 21:23:28 +01:00 committed by GitHub
parent c2f5c09692
commit 3d8a4d3b81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 40 additions and 52 deletions

View file

@ -1,2 +1,2 @@
// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown.
await import("https://example.com/some/file.ts");
await import("" + "https://example.com/some/file.ts");

View file

@ -1,5 +1,5 @@
error: Uncaught (in worker "") (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag
await import("https://example.com/some/file.ts");
await import("" + "https://example.com/some/file.ts");
^
at async http://localhost:4545/workers/dynamic_remote.ts:2:1
[WILDCARD]error: Uncaught (in promise) Error: Unhandled error in child worker.