Open halvardos opened 8 years ago
Proposals have to go through es-discuss and have a champion selected. I'm sure you could find someone to champion arbitrary currency symbols :p
I have tried to brush up on the contribution guidelines for es, and what the reason might be that only $ and _ is allowed. It might be that they are the only available ASCII chars that do not have special meaning in ES. I'm not to versed in unicode and character encoding so any input as to why that might be the reason would be appreciated.
I mean, it's far more likely that they just have eagles and handguns and are entirely too American to allow filthy socialist currency in their language.
realspeak: EUR/GBP/JPY/etc are in the Unicode Currency Symbol (Sc) block, which were just never greenlit for function names. Current ES6 ratified spec allows $
, _
, and anything in Uppercase (Lu), Lowercase (Ll), Titlecase (Lt), Modifier Letter (Lm) Other letter (Lo) or Letter Number (Nl) blocks to start a function and allows Non-spacing marks (Mn), Spacing combining marks (Mc), Decimal digit numbers (Nd) and Connector punctuation (Pc) blocks elsewhere in the function name. -- basically, Currency Symbols don't fall in the "letter" category, so they're not allowed in the grammar.
Ref. discussion on PR #3 about valid syntax.
As it stands, $ is the only currency symbol that is legal as the first character of an identifier. See ECMAscript 2015 spec
This is outrages and we should write a proposition to allow all currency symbols as the first character in an identifier.
I have no idea how one writes propositions to the ES specification so any help is appreciated.
A babel plugin would be awesome, see separate issue #5 .