tc39 / tc39/proposal-decorators
Suggestion: Allow function names starting with @
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 3k
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
Considering the @reactive decorator, its usage is very clear: @reactive accessor value.
However for the definition it is not that clear:
function reactive(target, desc) {
// ...
return { get, set, init }
}
It may looks more confusing if the decorator itself takes arguments.
So if it can be defined with a @ prefix in its name then everyone knows it is a decorator:
function @reactive(target, desc) { }
And this also allows decorators and normal functions share names:
function @foo () {}
funcition foo() {}
foo() // function foo is called
@foo // function @foo is chosen because it is more specific.
bar
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
Start with the decorator syntax and function examples in this issue, then compare the proposed @-prefixed names with the current decorators proposal. No files or tests are identified; done would require a decided syntax and its interactions with ordinary function names to be specified in the proposal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100