-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(op_crates/web): Use "deno:" URLs for internal script specifiers #7383
Conversation
This comment has been minimized.
This comment has been minimized.
cc @bartlomieju |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch - looks good.
I wonder if you could experiment with moving the test into the deno_web crate? Since this is a bug in deno_web, ideally the test would be there too.
This is experimental because we haven't yet developed good patterns for how to do tests in op crates. However this is a pretty simple situation - so it will be an instructive experiment. Consider not using itest.
@nayeemrmn thanks for this catch! The code looks good, I only wonder if we should show |
I'll look into adding a local test for relative script names. The panic is occurring in CLI, I think the
I agree, also we should show |
I guess that would be better... It would be cool to eventually use some sort of absolute URL (maybe |
I was actually just experimenting with Some kind of prefix is necessary to restore #4201, and we could do cool things like showing the source line for the first non-deno stack frame. |
@ry Please review. |
Nitpick: why |
@bartlomieju A bit better would be |
@@ -0,0 +1,3 @@ | |||
[WILDCARD]error: Uncaught TypeError: Event requires at least 1 argument, but only 0 present[WILDCARD] | |||
at new Event (deno:op_crates/web/[WILDCARD]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this seems pretty reasonable and clean.
@bartlomieju please land if you're okay with it this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, @nayeemrmn's right about the host part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @nayeemrmn
Fixes
deno.exe eval "new Event()"
panic. Described in #7369 (comment).Internal script specifiers use URLs in the form of
deno:<repo-relative path to file>
. That lets Deno developers conveniently Ctrl+click the paths (checked in VSCode).Additionally, having a clear prefix lets us restore dimming for internal stack frames: #4201.
The panic is fixed by ignoring
deno:
URLs when source mapping.