public final class CallNode extends OptionalExpression
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(NodeVisitor<? extends LexicalContext> visitor)
Assist in IR navigation.
|
<R> R |
accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Provides a means to navigate the IR.
|
static Expression |
forCall(int lineNumber,
long token,
int start,
int finish,
Expression function,
List<Expression> args) |
static Expression |
forCall(int lineNumber,
long token,
int start,
int finish,
Expression function,
List<Expression> args,
boolean optional,
boolean optionalChain) |
static Expression |
forCall(int lineNumber,
long token,
int start,
int finish,
Expression function,
List<Expression> args,
boolean optional,
boolean optionalChain,
boolean isEval,
boolean isApplyArguments,
boolean isDefaultDerivedConstructorSuperCall) |
static Expression |
forImport(int lineNumber,
long token,
int start,
int finish,
IdentNode importIdent,
List<Expression> args) |
static Expression |
forNew(int lineNumber,
long token,
int start,
int finish,
Expression function,
List<Expression> args) |
static Expression |
forTaggedTemplateLiteral(int lineNumber,
long token,
int start,
int finish,
Expression function,
List<Expression> args) |
List<Expression> |
getArgs()
Get the arguments for the call
|
Expression |
getFunction()
Return the function expression that this call invokes
|
int |
getLineNumber()
Returns the line number.
|
boolean |
isApplyArguments()
Check if this call is an apply call.
|
boolean |
isDefaultDerivedConstructorSuperCall() |
boolean |
isEval()
Check if this call is a call to
eval |
boolean |
isImport()
Check if this call is a dynamic import call.
|
boolean |
isNew()
Check if this call is a new operation
|
boolean |
isOptional()
Returns
true if this is an optional property access or call (a?.b,
a?.[b], or a?.()). |
boolean |
isOptionalChain()
Returns
true if this part of an optional chain. |
boolean |
isTaggedTemplateLiteral()
Check if this is a tagged template literal call.
|
CallNode |
setArgs(List<Expression> args)
Reset the arguments for the call
|
CallNode |
setFunction(Expression function)
Reset the function expression that this call invokes
|
void |
toString(StringBuilder sb,
boolean printType)
Print logic that decides whether to show the optimistic type or not - for example it should
not be printed after just parse, when it hasn't been computed, or has been set to a trivially
provable value
|
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedclone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringpublic static Expression forNew(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args)
public static Expression forCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args)
public static Expression forCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args, boolean optional, boolean optionalChain)
public static Expression forCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args, boolean optional, boolean optionalChain, boolean isEval, boolean isApplyArguments, boolean isDefaultDerivedConstructorSuperCall)
public static Expression forTaggedTemplateLiteral(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args)
public static Expression forImport(int lineNumber, long token, int start, int finish, IdentNode importIdent, List<Expression> args)
public int getLineNumber()
public Node accept(NodeVisitor<? extends LexicalContext> visitor)
public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodepublic void toString(StringBuilder sb, boolean printType)
Nodepublic List<Expression> getArgs()
public CallNode setArgs(List<Expression> args)
args - new arguments listpublic boolean isEval()
evalevalpublic Expression getFunction()
public CallNode setFunction(Expression function)
function - the functionpublic boolean isNew()
public boolean isImport()
public boolean isApplyArguments()
public boolean isOptional()
OptionalExpressiontrue if this is an optional property access or call (a?.b,
a?.[b], or a?.()).isOptional in class OptionalExpressionpublic boolean isOptionalChain()
OptionalExpressiontrue if this part of an optional chain.isOptionalChain in class OptionalExpressionpublic boolean isTaggedTemplateLiteral()
public boolean isDefaultDerivedConstructorSuperCall()