Class CallNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
com.oracle.js.parser.ir.OptionalExpression
com.oracle.js.parser.ir.CallNode
- All Implemented Interfaces:
Cloneable
IR representation for a function call.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Assist in IR navigation.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.static ExpressionforCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) static ExpressionforCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args, boolean optional, boolean optionalChain) static ExpressionforCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args, boolean optional, boolean optionalChain, boolean isEval, boolean isApplyArguments, boolean isDefaultDerivedConstructorSuperCall) static ExpressionforImport(int lineNumber, long token, int start, int finish, IdentNode importIdent, List<Expression> args, Module.ImportPhase phase) static ExpressionforNew(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) static ExpressionforTaggedTemplateLiteral(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) getArgs()Get the arguments for the callReturn the function expression that this call invokesintReturns the line number.booleanCheck if this call is an apply call.booleanbooleanisEval()Check if this call is a call toevalbooleanisImport()Check if this call is a dynamic import call.booleanCheck if this call is a dynamicimport.defercall.booleanCheck if this call is a dynamicimport.sourcecall.booleanisNew()Check if this call is a new operationbooleanReturnstrueif this is an optional property access or call (a?.b,a?.[b], ora?.()).booleanReturnstrueif this part of an optional chain.booleanCheck if this is a tagged template literal call.setArgs(List<Expression> args) Reset the arguments for the callsetFunction(Expression function) Reset the function expression that this call invokesvoidtoString(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 valueMethods inherited from class Expression
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedMethods inherited from class Node
clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Method Details
-
forNew
public static Expression forNew(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) -
forCall
public static Expression forCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) -
forCall
public static Expression forCall(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args, boolean optional, boolean optionalChain) -
forCall
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) -
forTaggedTemplateLiteral
public static Expression forTaggedTemplateLiteral(int lineNumber, long token, int start, int finish, Expression function, List<Expression> args) -
forImport
public static Expression forImport(int lineNumber, long token, int start, int finish, IdentNode importIdent, List<Expression> args, Module.ImportPhase phase) -
getLineNumber
public int getLineNumber()Returns the line number.- Returns:
- the line number.
-
accept
Assist in IR navigation. -
accept
Description copied from class:NodeProvides a means to navigate the IR. -
toString
Description copied from class:NodePrint 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 -
getArgs
-
setArgs
Reset the arguments for the call- Parameters:
args- new arguments list- Returns:
- new callnode, or same if unchanged
-
isEval
public boolean isEval()Check if this call is a call toeval- Returns:
- true if this is a call to
eval
-
getFunction
Return the function expression that this call invokes- Returns:
- the function
-
setFunction
Reset the function expression that this call invokes- Parameters:
function- the function- Returns:
- same node or new one on state change
-
isNew
public boolean isNew()Check if this call is a new operation- Returns:
- true if this a new operation
-
isImport
public boolean isImport()Check if this call is a dynamic import call. -
isImportSource
public boolean isImportSource()Check if this call is a dynamicimport.sourcecall. -
isImportDefer
public boolean isImportDefer()Check if this call is a dynamicimport.defercall. -
isApplyArguments
public boolean isApplyArguments()Check if this call is an apply call. -
isOptional
public boolean isOptional()Description copied from class:OptionalExpressionReturnstrueif this is an optional property access or call (a?.b,a?.[b], ora?.()).- Specified by:
isOptionalin classOptionalExpression
-
isOptionalChain
public boolean isOptionalChain()Description copied from class:OptionalExpressionReturnstrueif this part of an optional chain.- Specified by:
isOptionalChainin classOptionalExpression
-
isTaggedTemplateLiteral
public boolean isTaggedTemplateLiteral()Check if this is a tagged template literal call. -
isDefaultDerivedConstructorSuperCall
public boolean isDefaultDerivedConstructorSuperCall()
-