coffeescript icon indicating copy to clipboard operation
coffeescript copied to clipboard

Comment gets lost inside a function when using an existential operator

Open STRd6 opened this issue 3 years ago • 1 comments

->
  #@ts-ignore
  subsystem.clearCache?()

Actual

// Generated by CoffeeScript 2.6.1
(function() {
  return typeof subsystem.clearCache === "function" ? subsystem.clearCache() : void 0;
});

Expected

// Generated by CoffeeScript 2.6.1
(function() {
  //@ts-ignore
  return typeof subsystem.clearCache === "function" ? subsystem.clearCache() : void 0;
});

STRd6 avatar Apr 25 '22 23:04 STRd6

If you’d like to tackle this, https://github.com/jashkenas/coffeescript/issues/5366#issuecomment-922400143 has some links to get you started. I also see that issue, about outputting JSDoc comments properly, as a high priority.

GeoffreyBooth avatar Apr 26 '22 01:04 GeoffreyBooth