tc39 / tc39/proposal-private-declarations
Forbid splitting getter/setter across classes
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 26
- Forks
- 2
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Description
This horrible code:
private #foo;
class ReturnOverride {
constructor() {
return {
get outer #foo() {}
};
}
}
class AddSetter extends ReturnOverride {
set outer #foo(x) {}
}
new AddSetter;
or
class ReturnOverride {
get #foo () {}
static AddSetter = class extends ReturnOverride {
set outer #foo(x) {}
};
}
new ReturnOverride.AddSetter;
should not be legal (at runtime). I expect this will happen naturally in the spec but need to be sure (and have tests).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reading the proposal's runtime semantics around private getter/setter declarations, then check both examples in the issue. Done means the split getter/setter cases are rejected at runtime and tests cover both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100