Class StandardColors
This set describes any Color that needs to be used a priori by a compiler pass. That includes:
- "axiomatic" Colors (those with constant definitions, e.g. UNKNOWN)
- primitive Colors (e.g. `number`, `null`)
- box Colors (e.g. `Number`, `String`)
- Colors used in AstFactory to type synthetic nodes (e.g. `Array`)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorIdstatic final ColorIdstatic final ColorIdThe set of Colors whose definitions are independent of all JS code.static final Colorstatic final ColorIdstatic final Colorstatic final ColorIdstatic final ColorIdstatic final ColorIdstatic final ColorIdstatic final Colorstatic final Colorstatic final ColorIdstatic final com.google.common.collect.ImmutableSet<ColorId> The set of ColorIds for object Colors that "box" primitive Colors.The set of Colors that have associated runtime values but are not objects.static final ColorIdstatic final ColorIdstatic final Colorstatic final ColorIdstatic final Colorstatic final ColorIdstatic final ColorThe supertype of all objects but not primitives.static final ColorAnalagous to Closure '*'/'?' and TS unknown/any -
Method Summary
-
Field Details
-
ARGUMENTS_ID
-
ARRAY_ID
-
READONLY_ARRAY_ID
-
GENERATOR_ID
-
I_TEMPLATE_ARRAY_ID
-
ITERATOR_ID
-
ASYNC_ITERATOR_ITERABLE_ID
-
PROMISE_ID
-
BIGINT_OBJECT_ID
-
BOOLEAN_OBJECT_ID
-
NUMBER_OBJECT_ID
-
STRING_OBJECT_ID
-
SYMBOL_OBJECT_ID
-
BIGINT
-
BOOLEAN
-
NULL_OR_VOID
-
NUMBER
-
STRING
-
SYMBOL
-
TOP_OBJECT
The supertype of all objects but not primitives.Separate from UNKNOWN because some optimizations back off on any non-object primitives + unknown but operate on the top object.
-
UNKNOWN
Analagous to Closure '*'/'?' and TS unknown/any -
AXIOMATIC_COLORS
The set of Colors whose definitions are independent of all JS code.Because they have no dependencies, they are instantated once, here, and made globally available. No other Color object may ever have these IDs.
Some axiomatic Colors do not have an associated runtime type or set of runtime instances. These represent abstract concepts, rather than anything in a JSVM.
-
PRIMITIVE_COLORS
The set of Colors that have associated runtime values but are not objects.In JS, instances of primitve Colors are deeply immutable.
-
PRIMITIVE_BOX_IDS
The set of ColorIds for object Colors that "box" primitive Colors.Boxing is when the JSVM automatically wraps a primitive value in a temporary object so it can participate in a method call or other object-only operation.
The eaxct definition of each box Color may be altered by JS code.
-