-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add "name" property for classes as part of ClassDefinitionEvaluation #1372
Merged
Conversation
This file contains 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
ljharb
added
the
normative change
Affects behavior required to correctly evaluate some ECMAScript source text
label
Dec 17, 2018
ljharb
added
needs consensus
This needs committee consensus before it can be eligible to be merged.
needs test262 tests
The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262
labels
Jan 2, 2019
ljharb
reviewed
Jan 29, 2019
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.
Grammar's not my strong suit, so I'll defer to others for that part of the review.
ljharb
added
has consensus
This has committee consensus.
and removed
needs consensus
This needs committee consensus before it can be eligible to be merged.
labels
Jan 29, 2019
We got consensus on this change in the January 2019 TC39 meeting! Thanks everybody. @anba Would you be interested in writing tests for this change? |
anba
added a commit
to anba/test262
that referenced
this pull request
Jan 30, 2019
Created tc39/test262#2057 |
leobalter
pushed a commit
to tc39/test262
that referenced
this pull request
Jan 30, 2019
ljharb
added
has test262 tests
and removed
needs test262 tests
The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262
labels
Jan 30, 2019
bterlson
approved these changes
Feb 6, 2019
…Evaluation (tc39#1372) - Add definition for NamedEvaluation - Add NamedEvaluation operation when evaluating anonymous functions - Call SetFunctionName as part of ClassDefinitionEvaluation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
has consensus
This has committee consensus.
has test262 tests
normative change
Affects behavior required to correctly evaluate some ECMAScript source text
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.
SetFunctionName is currently called after ClassDefinitionEvaluation, which means the class name is not available in static class field initializers (tc39/proposal-class-fields#85) and may cause issues for a
@frozen
decorator (tc39/proposal-decorators#168).This PR moves the initialization of the "name" property into ClassDefinitionEvaluation, which should avoid both aforementioned issues. I've split this PR into three parts for easier reviewing:
The first commit 7bb51dd adds calls to a new runtime semantic
NamedEvaluation
to evaluate anonymous function definitions (as identified byIsAnonymousFunctionDefinition
).3d752d7 adds the actual definitions for
NamedEvaluation
.And the last commit 03fa5ba moves the "name" property assignment into ClassDefinitionEvaluation.
This PR doesn't result in any observable changes for non-class anonymous function definitions. For class definitions (with explicit and inferred names), the "name" property is now defined earlier, which is observable when calling
[[OwnPropertyKeys]]
. I don't expect to see any web-compatibility issues for this change given that all major engines already return the property keys of classes in a different order: