jashkenas / jashkenas/coffeescript
constructor renaming parameters
- Dominant language
- CoffeeScript
- Stars
- 16.6k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
If you do this
```coffeescript
class Blah
constructor:(@thing)->
@thing()
method:->
thing = "hi"
```
Coffeescript compiles to
```javascript
var Blah;
Blah = class Blah {
constructor(thing1) {
this.thing = thing1;
this.thing();
}
method() {
var thing;
return thing = "hi";
}
};
```
Why the 1 after the thing?? I'm using an dependency injection system, and the rename is playing havoc with it. Coffeescript 1 didn't do this.
Contributor guide
Research direction
Start by compiling the minimal CoffeeScript reproduction in the issue and compare the generated constructor parameter with the CoffeeScript 1 behavior described. Trace the compiler's parameter-renaming path and confirm the dependency-injection case is preserved without the unexpected suffix; add or update a regression test if the relevant test location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- coffeescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100