On this page

new BasicEvaluatedExpression(): BasicEvaluatedExpression
Attributes
array:<any[]>
bigint:<bigint>
expression:
{Program|AssignmentProperty|Property|CatchClause|ClassDeclaration|ClassExpression|ClassBody|Identifier|SimpleLiteral|RegExpLiteral|BigIntLiteral|ArrayExpression|ArrowFunctionExpression|AssignmentExpression|AwaitExpression|BinaryExpression|SimpleCallExpression|NewExpression|ChainExpression|ConditionalExpression|FunctionExpression|ImportExpression|LogicalExpression|MemberExpression|MetaProperty|ObjectExpression|SequenceExpression|TaggedTemplateExpression|TemplateLiteral|ThisExpression|UnaryExpression|UpdateExpression|YieldExpression|FunctionDeclaration|MethodDefinition|ImportDeclaration|ExportNamedDeclaration|ExportDefaultDeclaration|ExportAllDeclaration|ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier|ExportSpecifier|ObjectPattern|ArrayPattern|RestElement|AssignmentPattern|PrivateIdentifier|PropertyDefinition|SpreadElement|ExpressionStatement|BlockStatement|StaticBlock|EmptyStatement|DebuggerStatement|WithStatement|ReturnStatement|LabeledStatement|BreakStatement|ContinueStatement|IfStatement|SwitchStatement|ThrowStatement|TryStatement|WhileStatement|DoWhileStatement|ForStatement|ForInStatement|ForOfStatement|VariableDeclaration|Super|SwitchCase|TemplateElement|VariableDeclarator}
falsy:<boolean>
getMemberRanges:<object>
getMembers:<object>
getMembersOptionals:<object>
identifier:<string>
nullish:<boolean>
number:<number>
range:
{Tuple< number, number >}
regExp:<RegExp>
rootInfo:<string>
sideEffects:<boolean>
string:<string>
templateStringKind:
{"raw"|"cooked"}
truthy:<boolean>
wrappedInnerExpressions:<BasicEvaluatedExpression[]>
addOptions(options): BasicEvaluatedExpression
Attributes

Adds options to a conditional expression.


asBool(): boolean | undefined

Creates a boolean representation of this evaluated expression.


asCompileTimeValue(): string | number | bigint | boolean | RegExp | any[] | null | undefined

Gets the compile-time value of the expression


asNullish(): boolean | undefined

Creates a nullish coalescing representation of this evaluated expression.


asString(): string | undefined

Creates a string representation of this evaluated expression.


couldHaveSideEffects(): boolean
Returns:<boolean>

Can this expression have side effects?


isArray(): boolean
Returns:<boolean>

isBigInt(): boolean
Returns:<boolean>

isBoolean(): boolean
Returns:<boolean>

isCompileTimeValue(): boolean
Returns:<boolean>

Is expression a runtime or compile-time value?


isConditional(): boolean
Returns:<boolean>

isConstArray(): boolean
Returns:<boolean>

isFalsy(): boolean
Returns:<boolean>

isIdentifier(): boolean
Returns:<boolean>

isNull(): boolean
Returns:<boolean>

isNullish(): boolean | undefined

isNumber(): boolean
Returns:<boolean>

isPrimitiveType(): boolean | undefined

Is expression a primitive or an object type value?


isRegExp(): boolean
Returns:<boolean>

isString(): boolean
Returns:<boolean>

isTemplateString(): boolean
Returns:<boolean>

isTruthy(): boolean
Returns:<boolean>

isUndefined(): boolean
Returns:<boolean>

isUnknown(): boolean
Returns:<boolean>

isWrapped(): boolean
Returns:<boolean>

setArray(array): BasicEvaluatedExpression
Attributes

Set's the value of this expression to an array of strings.


setBigInt(bigint): BasicEvaluatedExpression
Attributes
bigint:<bigint>

Set's the value of this expression to a BigInt


setBoolean(bool): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a boolean


setExpression(expression?): void
  • expression {Program|AssignmentProperty|Property|CatchClause|ClassDeclaration|ClassExpression|ClassBody|Identifier|SimpleLiteral|RegExpLiteral|BigIntLiteral|ArrayExpression|ArrowFunctionExpression|AssignmentExpression|AwaitExpression|BinaryExpression|SimpleCallExpression|NewExpression|ChainExpression|ConditionalExpression|FunctionExpression|ImportExpression|LogicalExpression|MemberExpression|MetaProperty|ObjectExpression|SequenceExpression|TaggedTemplateExpression|TemplateLiteral|ThisExpression|UnaryExpression|UpdateExpression|YieldExpression|FunctionDeclaration|MethodDefinition|ImportDeclaration|ExportNamedDeclaration|ExportDefaultDeclaration|ExportAllDeclaration|ImportSpecifier|ImportDefaultSpecifier|ImportNamespaceSpecifier|ExportSpecifier|ObjectPattern|ArrayPattern|RestElement|AssignmentPattern|PrivateIdentifier|PropertyDefinition|SpreadElement|ExpressionStatement|BlockStatement|StaticBlock|EmptyStatement|DebuggerStatement|WithStatement|ReturnStatement|LabeledStatement|BreakStatement|ContinueStatement|IfStatement|SwitchStatement|ThrowStatement|TryStatement|WhileStatement|DoWhileStatement|ForStatement|ForInStatement|ForOfStatement|VariableDeclaration|Super|SwitchCase|TemplateElement|VariableDeclarator}
  • Returns: <BasicEvaluatedExpression>

Set the expression node for the expression.


setFalsy(): BasicEvaluatedExpression

setIdentifier(identifier, rootInfo, getMembers, getMembersOptionals?, getMemberRanges?): BasicEvaluatedExpression
Attributes
identifier:<string>
rootInfo:<string>
getMembers:<object>
getMembersOptionals:<object>
getMemberRanges:<object>

Set's the value of this expression to a particular identifier and its members.


setItems(items): BasicEvaluatedExpression
Attributes

Set's the value of this expression to an array of expressions.


setNull(): BasicEvaluatedExpression

setNullish(value): BasicEvaluatedExpression
Attributes
value:<boolean>

Set's the value of the expression to nullish.


setNumber(number): BasicEvaluatedExpression
Attributes
number:<number>

Set's the value of this expression to a number


setOptions(options): BasicEvaluatedExpression
Attributes

Stores the options of a conditional expression.


setRange(range): void

Set's the range for the expression.


setRegExp(regExp): BasicEvaluatedExpression
Attributes
regExp:<RegExp>

Set's the value of this expression to a regular expression


setSideEffects(sideEffects?): BasicEvaluatedExpression
Attributes
sideEffects:<boolean>

Set whether or not the expression has side effects.


setString(string): BasicEvaluatedExpression
Attributes
string:<string>

setTemplateString(quasis, parts, kind): BasicEvaluatedExpression
Attributes

Set's the value of this expression to a processed/unprocessed template string. Used for evaluating TemplateLiteral expressions in the JavaScript Parser.


setTruthy(): BasicEvaluatedExpression

setUndefined(): BasicEvaluatedExpression

setWrapped(prefix?, postfix?, innerExpressions?): BasicEvaluatedExpression
Attributes

Wraps an array of expressions with a prefix and postfix expression.