Skip to content
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

Normative: Prevent DFS invariants from being broken #1669

Open
wants to merge 1 commit into
base: master
from

Conversation

@devsnek
Copy link
Member

commented Aug 14, 2019

An implementation of HostImportModuleDynamically, could, in theory, call
Evaluate() in the same tick as the call to HostImportModuleDynamically.
If that call to HostImportModuleDynamically was the direct result of
another call to Evaluate(), this may eagerly evaluate a module that
is already queued to be run at a later time.

cc @guybedford

@guybedford
Copy link

left a comment

This is a really important invariant of the DFS algorithm not to be interrupted during its search by another search, as the algorithm isn't designed to run in parallel with other algorithms.

This is also an important invariant for the top-level await spec too.

spec.html Show resolved Hide resolved
@Ms2ger
Ms2ger approved these changes Sep 2, 2019
Copy link
Contributor

left a comment

This makes sense to me.

spec.html Show resolved Hide resolved

@devsnek devsnek force-pushed the devsnek:fix/evaluate-timing branch from d3caf36 to c77d256 Sep 4, 2019

@ljharb ljharb requested a review from domenic Sep 4, 2019

@littledan

This comment has been minimized.

Copy link
Member

commented Sep 4, 2019

Should we make this a requirement on host environments, in addition to an assertion?

@domenic
domenic approved these changes Sep 4, 2019
Copy link
Member

left a comment

LGTM. @littledan's suggestion also makes sense, but I think without #735 (or some other acknowledgment of the fact that hosts are actually going to be the ones driving module evaluation), it's unclear where to put such a requirement.

@ljharb ljharb requested a review from tc39/ecma262-editors Sep 4, 2019

@ljharb
ljharb approved these changes Sep 4, 2019

@ljharb ljharb force-pushed the devsnek:fix/evaluate-timing branch from c77d256 to 74182ab Sep 5, 2019

Normative: Prevent DFS invariants from being broken (#1669)
An implementation of HostImportModuleDynamically, could, in theory, call
Evaluate() in the same tick as the call to HostImportModuleDynamically.
If that call to HostImportModuleDynamically was the direct result of
another call to Evaluate(), this may eagerly evaluate a module that
is already queued to be run at a later time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.