Decorator-based extended numeric literals
Daniel Ehrenberg
Igalia
In partnership with Bloomberg
January 2019 TC39
Goals of this presentation
Motivation: Generalize new numeric literals
Syntax
PrimaryExpression[Yield, Await] :� ...� ExtendedNumericLiteral��ExtendedNumericLiteral ::� NumericLiteral @ IdentifierPart Arguments_opt�
Semantics
decorator @i { @numericTemplate(impl) }
1234@i
→
impl(Object.freeze({string: "1234", number: 1234}))
Why decorators?
Removes ambiguity with numeric separators
Status
Does this path seem promising?
Can we restore Numeric Separators to Stage 3?