Skip to content

Ensure there is an active script while running JS jobs - #3163

Merged
domenic merged 2 commits into
masterfrom
enqueuejob-script
Nov 17, 2017
Merged

domenic merged 2 commits into
masterfrom
enqueuejob-script

Conversation

@domenic

@domenic domenic commented Oct 27, 2017 •

Copy link
Copy Markdown
Member

"Fixes" tc39/ecma262#871, at least for HTML, given that we have our own version of EnqueueJob. Important for #3117.


People who may be interested in reviewing this: @anba @bzbarsky @nyaxt. Alternately I'm happy with just editorial review as this stuff is pretty subtle.

Tests: web-platform-tests/wpt#8287

@domenic domenic added the topic: script The script element, fetching and running scripts and modules, and settings objects and realms label Oct 27, 2017
Comment thread source Outdated

<p class="note">This affects the <span>active script</span> while the job runs, in cases like
<code data-x="">Promise.resolve("...").then(eval)</code> where there would otherwise be no
active script since <code data-x="">eval</code> is a built-in function that does not original

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/original/originate/?

@anba

anba commented Nov 1, 2017

Copy link
Copy Markdown

This appears to be correct for fixing tc39/ecma262#871 in HTML, but it could be that I'm missing some HTML-specific details, because I simply don't know the HTML spec that well. 😄

And I'm still wondering if calling GetActiveScriptOrModule and creating a new execution context (or its equivalent in actual implementations), will be an expensive operation in implementations, because it needs to be done whenever a new Promise Job gets enqueued. Well, let's just see what implementors think of this change.

@domenic

domenic commented Nov 17, 2017

Copy link
Copy Markdown
Member Author

Tests are up. This is ready for review/merging.

@sideshowbarker sideshowbarker left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as editorial review

@annevk

annevk commented Nov 17, 2017

Copy link
Copy Markdown
Member

It seems this includes a commit that shouldn't be here.

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving "Ensure there is an active script while running JS jobs" only.

Comment thread source Outdated
<li><p><span>Prepare to run a callback</span> with <var>incumbent settings</var>.</p></li>
<p class="note">This affects the <span>active script</span> while the job runs, in cases like
<code data-x="">Promise.resolve("...").then(eval)</code> where there would otherwise be no
active script since <code data-x="">eval</code> is a built-in function that does not originate

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eval()

"Fixes" tc39/ecma262#871, at least for HTML,
given that we have our own version of EnqueueJob. Important for #3117.
@domenic
domenic merged commit cc3fcc8 into master Nov 17, 2017
@domenic
domenic deleted the enqueuejob-script branch November 17, 2017 16:48
jgraham pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 21, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 30, 2018
…ise jobs, a=testonly

Automatic update from web-platform-testsTest active script, via import(), in promise jobs

Follows whatwg/html#3163.

--

wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c
wpt-pr: 8287
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 2, 2019
…ise jobs, a=testonly

Automatic update from web-platform-testsTest active script, via import(), in promise jobs

Follows whatwg/html#3163.

--

wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c
wpt-pr: 8287

UltraBlame original commit: 89d303876a7e1b2b43d099822477b7f80333b71b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…ise jobs, a=testonly

Automatic update from web-platform-testsTest active script, via import(), in promise jobs

Follows whatwg/html#3163.

--

wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c
wpt-pr: 8287

UltraBlame original commit: 89d303876a7e1b2b43d099822477b7f80333b71b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…ise jobs, a=testonly

Automatic update from web-platform-testsTest active script, via import(), in promise jobs

Follows whatwg/html#3163.

--

wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c
wpt-pr: 8287

UltraBlame original commit: 89d303876a7e1b2b43d099822477b7f80333b71b
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…ise jobs, a=testonly

Automatic update from web-platform-testsTest active script, via import(), in promise jobs

Follows whatwg/html#3163.

--

wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c
wpt-pr: 8287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: script The script element, fetching and running scripts and modules, and settings objects and realms

Development

Successfully merging this pull request may close these issues.

5 participants