-
Notifications
You must be signed in to change notification settings - Fork 45
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
related to issue #88: refactor to use a list of stages instead of internal slots for each state. #91
Conversation
…of internal slots for each state.
@@ -153,32 +153,13 @@ mean the same thing as: | |||
1. Return the result of calling OrdinaryDefineOwnProperty(_obj_, _name_, _desc_). | |||
</emu-alg> | |||
|
|||
<h4 id="get-state-value" aoid="GetStateValue">GetStateValue(state)</h4> |
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.
stages are now in an ordered list, not need to track down the numeric values.
1. Return *undefined*. | ||
1. Call SimpleDefine(_result_, "statePromise", _statePromise_). | ||
1. If _entry_.[[State]] is "ready" then let _module_ be _entry_.[[Module]]. | ||
1. Call SimpleDefine(_result_, "stage", _stage_). |
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.
Question: right now we are exposing stage
and stagePromise
as part of the shim for the registry entry. I think we can make this stage
and value
, which is just the thenable value for the entry's "ready" stage, or the current stage.
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.
Let's call them stage
and result
to match the semantics.
But we might want to consider exposing the full pipeline list. Something we should think about.
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.
result
it is then.
<emu-alg> | ||
1. If Type(_entry_) is not Object, throw a *TypeError* exception. | ||
1. Let _stages_ be _entry_.[[Pipeline]]. | ||
1. Return the first element of _stages_. |
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.
add an assert: stages is non-empty.
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.
it can't be empty. it is created by EnsureRegistered() or .install(), either way you can't never make it empty, you can only upgrade to an existent stage.
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.
added a note about it.
@@ -584,7 +589,13 @@ Registry instances are initially created with the internal slots described in th | |||
1. If _pair_ exists, then: | |||
1. Let _entry_ be _pair_.[[value]]. | |||
1. Else: | |||
1. Let _entry_ be a new registry entry record { [[Key]]: _key_, [[State]]: "fetch", [[Metadata]]: *undefined*, [[Fetch]]: *undefined*, [[Translate]]: *undefined*, [[Instantiate]]: *undefined*, [[Dependencies]]: *undefined*, [[Module]]: *undefined*, [[Error]]: *nothing* }. | |||
1. Let _pipeline_ to be a new List. |
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.
Let pipeline be
Looks great. I have a couple tiny nits in the comments. Otherwise r+ |
related to issue #88: refactor to use a list of stages instead of internal slots for each state.
Changes:
state
is nowstage
in the pipeline, which is more clear.CommitInstantiate
toExtractDependencies
.Rendered HTML: