Logo Xantham

SharedLiterals Module

Functions and values

Function or value Description

addHome ctx key home

Full Usage: addHome ctx key home

Parameters:

recordRefOwner ctx key

Full Usage: recordRefOwner ctx key

Parameters:

Record (during the counting pre-pass) that the union-member object-literal `key` is referenced by the current top-level owner. A `key` with >1 distinct referencing owner is shared and is canonicalized into `SharedLiterals` alongside the def-VISIT-gated literals. No-op outside the counting pass (`SharedLiteralRefOwners`/`CurrentRefOwner` unset).

ctx : GeneratorContext
key : ResolvedType

tryGetHome ctx key

Full Usage: tryGetHome ctx key

Parameters:
Returns: TypePath voption

The canonical owner-independent home (if any) for a shared hoisted object-literal.

ctx : GeneratorContext
key : ResolvedType
Returns: TypePath voption

Type something to start searching.