This document describes an alternative to the Extended Numeric Literals proposal. This design's primary goals are to avoid conflict with the Stage 3 Numeric Literal Separator feature and to provide a mechanism that protects extensions from shadowing hazards.
The Number.extensions object is the %Number_extensions% intrinsic object and the initial value of the extensions
property of the Number
object. The Number.extensions object is a single ordinary object.
The value of the [[Prototype]] internal slot of the Number.extensions object is the intrinsic object
The Number.extensions object is not a function object. It does not have a [[Construct]] internal method; it is not possible to use the Number.extensions object as a constructor with the new
operator. The Number.extensions object also does not have a [[Call]] internal method; it is not possible to invoke the Number.extensions object as a function.
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
This object provides functions to interact with the [[NumericExtensionHandlerMap]].
Function Name | Behavior |
---|---|
has( extensionKey)
|
When the
|
register( extensionKey, handler)
|
When the
|
All methods of this instance have the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
"string"
, string)."number"
, number)."frozen"
).Field Name | Value | Meaning |
---|---|---|
[[NumericExtensionMap]] |
A |
Literal objects are canonicalized separately for each |
[[NumericExtensionHandlerMap]] |
A |
Literal objects are canonicalized separately for each |
Intrinsic Name | Global Name | ECMAScript Language Association |
---|---|---|
|
Number.extensions
|
The initial value of the extensions data property of |