jashkenas / jashkenas/coffeescript

Grammar, Nodes: Class fields/class property initializers

Open
#4,552 24 comments 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
CoffeeScript
Stars
16.6k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

We should be able to write the equivalent of
```js
class C {
b = 3;
c = () => 4;
}
```
Can it be
```coffee
class C
b: 3
c: () => 4;
```
or does the `b` property have different semantics?

Contributor guide

Open the contributing guide

Research direction

Start with the grammar and Nodes areas implicated by the title, and compare the requested CoffeeScript examples with their JavaScript class-field equivalents. Resolve whether instance property initializers have the same semantics, then define the accepted syntax and its expected output; the issue provides no file or test path.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, javascript
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.