|
|
|
|
|
by withjive
5601 days ago
|
|
What's the chance of also getting optional Type Annotations into CoffeScript core as well? As this would greatly help the closure compiler do optimisations, and since it is opt-in to add the typed parameter and would only produce a javascript comment above said variable. For example.... foo <: String = "hey" /* @type {String} */
var foo = "hey" I don't think this is deviating from CoffeeScript's aim to keep things pure? Is it? |
|
That said, statically marking your variables with "types" (where types are incredibly weak and limited in JavaScript) isn't going to be of much use to you, performance-wise. Modern engines like V8 already unbox local variables where possible, and do "hidden class" analysis to give a "type" even to regular unstructured JS objects.