new StackedMap(): StackedMapReturns:
<StackedMap><
<K>
,
<V>
>map{Map<K, InternalCell>} size<number>Returns the number of visible keys after collapsing the stack.stack{Map<K, InternalCell>[]}
asArray(): K[]Returns:
{K[]}
Returns the visible keys as an array after collapsing the stack.
asMap(): Map<K, Cell<V>>Returns:
{Map<K, Cell
>}
Returns the visible contents as a plain Map.
asPairArray(): [K, Cell<V>][]Returns:
{[K, Cell
][]}
Returns visible key/value pairs using the external representation.
asSet(): Set<K>Returns:
{Set
}
Returns the visible keys as a Set after collapsing the stack.
createChild(): StackedMapReturns:
<StackedMap><
<K>
,
<V>
>Creates a child StackedMap that sees the current layers as its parent
scope.
delete(item): voiditem{K}- Returns:
<void>
Deletes a key from the current view, either by removing it outright in the root layer or by recording a tombstone in child layers.
M
get
get(item): voiditem{K}- Returns: {Cell
}
Returns the visible value for a key, caching parent hits and misses in the current layer.
M
has
has(item): voiditem{K}- Returns:
<boolean>
Checks whether a key exists in the current scope chain, caching any parent lookup result in the current layer.
M
set
set(item, value): voiditem{K}value{V}- Returns:
<void>
Stores a value in the current layer, preserving explicit undefined
values with an internal marker.
Type:
<undefined>
|
<T>Type:
<T>
|
<typeof TOMBSTONE>
|
<typeof UNDEFINED_MARKER>