Skip to content

(ignore) Normative: Add public and private class fields #1655

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 12, 2021

Conversation

Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Aug 6, 2019

This includes changes from https://tc39.es/proposal-class-fields/.

@ljharb ljharb added normative change Affects behavior required to correctly evaluate some ECMAScript source text pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 labels Aug 7, 2019
@ljharb ljharb requested review from ljharb, zenparsing, littledan and a team August 7, 2019 22:20
spec.html Outdated
1. Replace all occurances of "Return a value of type Reference..." with calls to MakeReference
2. Rename MakeSuperPropertyReference to MakeSuperReference for consistency.

<emu-clause id="sec-makereference" aoid="MakeReference">
Copy link
Member

Choose a reason for hiding this comment

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

should this commented clause be deleted, or uncommented?

ljharb
ljharb previously requested changes Aug 15, 2019
spec.html Outdated
@@ -3309,6 +3322,29 @@ <h1>InitializeReferencedBinding ( _V_, _W_ )</h1>
1. Return _base_.InitializeBinding(GetReferencedName(_V_), _W_).
</emu-alg>
</emu-clause>

<!--
1. Replace all occurences of "Return a value of type Reference..." with calls to MakeReference
Copy link
Member

Choose a reason for hiding this comment

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

this commented section should be uncommented or removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This still needs doing, yes. I'm holding off in case there's substantive comments that affect it.

spec.html Outdated
1. Let _fields_ be the value of _constructor_.[[Fields]].
1. For each item _fieldRecord_ in order from _fields_,
1. Perform ? DefineField(_O_, _fieldRecord_).
1. Return.
Copy link
Member

Choose a reason for hiding this comment

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

this last step seems kind of implied to me, can/should it be removed?

spec.html Outdated

<emu-grammar>ClassElement : FieldDefinition `;`</emu-grammar>
<ul>
<li>It is a Syntax Error if PropName of |FieldDefinition| is `"constructor"`.</li>
Copy link
Member

Choose a reason for hiding this comment

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

@Ms2ger "class fields" has been a single proposal since before stage 3; all of it should be added in a single PR - static and instance, public and private.

</emu-alg>

For all other grammatical productions, recurse on all nonterminals. If any piece returns *true*, then return *true*. Otherwise return *false*.
<emu-note type=editor>TODO: Elaborate the preceding paragraph with spec text inserted in each relevant place</emu-note>
Copy link
Member

Choose a reason for hiding this comment

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

this TODO seems like it needs doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same: This still needs doing, yes. I'm holding off in case there's substantive comments that affect it.

@littledan littledan 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 Sep 2, 2019
@ljharb
Copy link
Member

ljharb commented Sep 2, 2019

Deferring to #1668; I’ll keep this one up to date.

@ljharb ljharb changed the title Normative: Add public and private class fields. (ignore) Normative: Add public and private class fields Sep 2, 2019
@ljharb ljharb self-assigned this Sep 2, 2019
Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

Step 2.12.2.8.a.ii and 2.12.2.8.a.iii are missing in this PR yet presented in https://tc39.es/proposal-class-fields/#runtime-semantics-class-definition-evaluation.

@littledan
Copy link
Member

@legendecas If you could make a PR to this branch (and the other branches) fixing the issue, then I can merge it in to fix this PR.

@legendecas
Copy link
Member

@littledan If you could make a PR to this branch (and the other branches) fixing the issue, then I can merge it in to fix this PR.

The branch is on @Ms2ger's repo, the PR has to be updated in their repo. So maybe pushing the branch to tc39/ecma262 and till then we can target the branch and review PRs in tc39/ecma262.

@ljharb
Copy link
Member

ljharb commented Jan 27, 2020

@legendecas you can make a PR directly to that repo (rather than opening up a fourth PR here)

@ljharb ljharb marked this pull request as draft July 15, 2020 21:57
…, private methods & getters/setters

This includes changes from https://tc39.es/proposal-class-fields/.
This includes changes from https://tc39.es/proposal-private-methods/.
This includes changes from https://tc39.es/proposal-static-class-features/.

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
Co-authored-by: Ujjwal Sharma <ryzokuken@igalia.com>
Co-authored-by: Caio Lima <ticaiolima@gmail.com>
Co-authored-by: Michael Dyck <jmdyck@ibiblio.org>
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@ljharb ljharb marked this pull request as ready for review May 12, 2021 21:40
@ljharb ljharb dismissed their stale review May 12, 2021 21:40

no longer an editor; everything addressed in #1668

@ljharb ljharb marked this pull request as draft May 12, 2021 21:40
@ljharb ljharb merged commit 56b5e8b into tc39:master May 12, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
has test262 tests normative change Affects behavior required to correctly evaluate some ECMAScript source text pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants