Repository navigation
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.
annevk
left a comment
There was a problem hiding this comment.
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.
This is inside a set of substeps that run in parallel.
There was a problem hiding this comment.
How can you report an exception from there?
There was a problem hiding this comment.
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.
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 )