Editorial: Centralize strictness-determination for function definitions#1563
Merged
ljharb merged 1 commit intotc39:masterfrom Jun 17, 2019
Merged
Editorial: Centralize strictness-determination for function definitions#1563ljharb merged 1 commit intotc39:masterfrom
ljharb merged 1 commit intotc39:masterfrom
Conversation
437e9fd to
de231cf
Compare
Collaborator
Author
|
(force-pushed to resolve merge conflicts) |
zenparsing
approved these changes
Jun 17, 2019
ljharb
approved these changes
Jun 17, 2019
Formerly, for every different form of function definition,
we would ask whether:
the function code for the function definition is strict mode code
and then pass the result to *FunctionCreate,
and from there to FunctionAllocate.
Instead, we can equivalently ask whether:
the source text of the function definition's body is strict mode code.
The thing is, *this* question can be asked for all function definitions
in one place: FunctionInitialize.
So do that, and drop the _strict_ parameter from FunctionAllocate.
de231cf to
3bc01d4
Compare
jmdyck
added a commit
to jmdyck/html
that referenced
this pull request
Jun 17, 2019
In the ECMAScript spec, the recently merged [PR whatwg#1563](tc39/ecma262#1563) dropped the 'Strict' parameter from the abstract operation FunctionCreate (since its setting can be determined from the 'Body' parameter). Make the corresponding change to HTML's only call to FunctionCreate. And delete the step that sets up the 'strict' variable. And, since that step had the only references to "Directive Prologue" and "Use Strict Directive", remove those from the "JavaScript terms used" list.
domenic
pushed a commit
to whatwg/html
that referenced
this pull request
Jun 19, 2019
In the ECMAScript spec, the recently-merged tc39/ecma262#1563 dropped the 'Strict' parameter from the abstract operation FunctionCreate (since its setting can be determined from the 'Body' parameter). This commit makes the corresponding change to HTML's only call to FunctionCreate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formerly, for every different form of function definition, we would ask whether:
and then pass the result to *FunctionCreate, and from there to FunctionAllocate.
Instead, we can equivalently ask whether:
The thing is, this question can be asked for all function definitions in one place: FunctionInitialize.
So do that, and drop the strict parameter from FunctionAllocate. (In #1562, I said we could eliminate one of the parameters: this is it.)
Downstream effect:
HTML has one call to FunctionCreate, whose signature is changed by this PR. The value that it passes to the Strict parameter is the same as what would be determined by FunctionInitialize, so dropping that argument (and step 8 that sets it) would preserve semantics. (Note that step 8 has HTML's only references to 'Directive Prologue' and 'Use Strict Directive', so those could then be dropped from its "terms used" list.)