public final class DestructuredTarget
extends java.lang.Object
Call inferType
to do type inference on the target lazily. This class is designed so
that a caller can get information about a target, use that information to do additional type
inference, and finally call inferType
if desired.
Type | Property and Description |
---|---|
boolean |
hasComputed |
Modifier and Type | Method and Description |
---|---|
static com.google.common.collect.ImmutableList<DestructuredTarget> |
createAllNonEmptyTargetsInPattern(JSTypeRegistry registry,
JSType patternType,
Node pattern)
Returns all the targets directly in the given pattern, except for EMPTY nodes
|
static com.google.common.collect.ImmutableList<DestructuredTarget> |
createAllNonEmptyTargetsInPattern(JSTypeRegistry registry,
com.google.common.base.Supplier<JSType> patternType,
Node pattern)
Returns all the targets directly in the given pattern, except for EMPTY nodes
|
Node |
getComputedProperty()
Returns a COMPUTED_PROP node or null
|
Node |
getDefaultValue() |
Node |
getNode() |
Node |
getStringKey()
Returns a STRING_KEY node or null
|
boolean |
hasComputedProperty() |
boolean |
hasDefaultValue() |
boolean |
hasStringKey() |
@Nullable public Node getComputedProperty()
public boolean hasComputedProperty()
public boolean hasStringKey()
@Nullable public Node getStringKey()
@Nullable public Node getDefaultValue()
public boolean hasDefaultValue()
public Node getNode()
public static com.google.common.collect.ImmutableList<DestructuredTarget> createAllNonEmptyTargetsInPattern(JSTypeRegistry registry, JSType patternType, Node pattern)
EMPTY nodes occur in array patterns with elisions, e.g. `[, , a] = []`
public static com.google.common.collect.ImmutableList<DestructuredTarget> createAllNonEmptyTargetsInPattern(JSTypeRegistry registry, com.google.common.base.Supplier<JSType> patternType, Node pattern)
EMPTY nodes occur in array patterns with elisions, e.g. `[, , a] = []`
Copyright © 2009-2020 Google. All Rights Reserved.