-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 import() inside setTimeout()/setInterval() strings #3117
Conversation
The base URL ones follow whatwg/html#3117.
When you get the active script here, can you be sure it's not null? Might be nice to add an assert. |
b77b7f6
to
63669d2
Compare
I actually cannot guarantee that. This is basically tc39/ecma262#871 all over again, arg. Let me think harder... |
Fixes tc39/ecma262#871, given that we have our own version of EnqueueJob. Important for #3117.
Fixes tc39/ecma262#871, given that we have our own version of EnqueueJob. Important for #3117.
"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for #3117.
"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for #3117.
"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for #3117.
"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for #3117.
81d77cf
to
eb9f6f5
Compare
This is ready for re-review. Working on tests now. |
Closes #3116. Before this change, the "new script"-ness of setTimeout() and setInterval()'s string compilation was making any import() calls inside the compiled source behave unexpectedly. After this, they behave like eval().
eb9f6f5
to
5f001ce
Compare
Follows whatwg/html#3117. Parser state is implicitly tested because lots of tests would otherwise fail. Referrer policy tests omitted for now since you can only set that via modulepreload at the moment.
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 assume there are tests for the base URL thing? That it does indeed come from that script and not some settings object? Because I thought that the base URL always came from a settings object, but I might not have paid enough attention to all the settings object changes.
<var>calleeRealm</var>). If this throws an exception, catch it, and <span>report the | ||
exception</span>.</p></li> | ||
<var>calleeRealm</var>). If this throws an exception, catch it, <span>report the | ||
exception</span>, and abort these steps.</p></li> |
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.
return?
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.
This is inside a set of substeps that run in parallel.
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.
How can you report an exception from there?
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.
Sorry, they run inside a task that is enqueued from in parallel. See https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps for the actual context.
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.
In that case return seems fine, since it's a synchronous algorithm, but okay either way.
Yeah, the -base-url tests in web-platform-tests/wpt#7684 test what you're referring to. |
lgtm |
Follows whatwg/html#3117. Parser state is implicitly tested because lots of tests would otherwise fail. Referrer policy tests omitted for now since you can only set that via modulepreload at the moment.
"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for whatwg#3117.
This fixes part of #3116, leaving the question of cryptographic nonce
and parser metadata for later. For these two, the only impact is on
dynamic import() inside such strings.
Tests: web-platform-tests/wpt#7684
@nyaxt to review
/timers-and-user-prompts.html ( diff )