jashkenas / jashkenas/coffeescript
Comment gets lost inside a function when using an existential operator
- Dominant language
- CoffeeScript
- Stars
- 16.6k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
```coffee
->
#@ts-ignore
subsystem.clearCache?()
```
Actual
```js
// Generated by CoffeeScript 2.6.1
(function() {
return typeof subsystem.clearCache === "function" ? subsystem.clearCache() : void 0;
});
```
Expected
```js
// Generated by CoffeeScript 2.6.1
(function() {
//@ts-ignore
return typeof subsystem.clearCache === "function" ? subsystem.clearCache() : void 0;
});
```
Contributor guide
Research direction
Start by compiling the provided CoffeeScript snippet with CoffeeScript 2.6.1 and compare the generated JavaScript with the expected output. Trace how the comment is handled around the existential operator, then add coverage showing that the comment is retained before the generated return statement.
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
- Clearly specified
- Newbie friendliness
- 45/100