An instance is allocated for a large share of walked expressions, so the boolean facts live in one packed flags slot and the scalar/identifier fields in five slots shared by type, with accessors keeping every public field readable. This shrinks instances from 224 to 144 bytes on V8.
new BasicEvaluatedExpression(): BasicEvaluatedExpression
BasicEvaluatedExpressionany[]bigintbooleanAssignmentProperty | 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 | Program | 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 | VariableDeclaratorboolean() => string[]() => boolean[]string | VariableInfoBasicEvaluatedExpression[]booleannumberBasicEvaluatedExpression[]BasicEvaluatedExpression[]BasicEvaluatedExpression | nullBasicEvaluatedExpression | nullBasicEvaluatedExpression[]evaluateExpression
's plain results share the expression's range, and
most evaluations never read it, so the node's range array is only
materialized on demand.RegExpstring | VariableInfobooleanstring"cooked" | "raw"booleannumberBasicEvaluatedExpression[]addOptions(options): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionAdds the provided basic evaluated expression to the basic evaluated expression.
asBool(): boolean | undefined
Creates a boolean representation of this evaluated expression.
asCompileTimeValue(): string | number | bigint | boolean | RegExp | any[] | null | undefined
As compile time value.
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
booleanCan this expression have side effects?
isArray(): boolean
booleanisBigInt(): boolean
booleanisBoolean(): boolean
booleanisCompileTimeValue(): boolean
booleanIs expression a runtime or compile-time value?
isConditional(): boolean
booleanisConstArray(): boolean
booleanisFalsy(): boolean
booleanisIdentifier(): boolean
booleanisNull(): boolean
booleanisNullish(): boolean | undefined
isNumber(): boolean
booleanisPrimitiveType(): boolean | undefined
Is expression a primitive or an object type value?
isRegExp(): boolean
booleanisString(): boolean
booleanisTemplateString(): boolean
booleanisTruthy(): boolean
booleanisUndefined(): boolean
booleanisUnknown(): boolean
booleanisWrapped(): boolean
booleansetArray(array): BasicEvaluatedExpression
string[]BasicEvaluatedExpressionSet's the value of this expression to an array of strings.
setBigInt(bigint): BasicEvaluatedExpression
bigintBasicEvaluatedExpressionSet's the value of this expression to a BigInt
setBoolean(bool): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet's the value of this expression to a boolean
setExpression(expression?): BasicEvaluatedExpression
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 | Program | 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 | VariableDeclaratorBasicEvaluatedExpressionSet the expression node for the expression.
setFalsy(): BasicEvaluatedExpression
BasicEvaluatedExpressionsetIdentifier(identifier, rootInfo, getMembers, getMembersOptionals?, getMemberRanges?): BasicEvaluatedExpression
string | VariableInfostring | VariableInfo() => string[]() => boolean[]BasicEvaluatedExpressionSet's the value of this expression to a particular identifier and its members.
setItems(items): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionSet's the value of this expression to an array of expressions.
setNull(): BasicEvaluatedExpression
BasicEvaluatedExpressionsetNullish(value): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet's the value of the expression to nullish.
setNumber(number): BasicEvaluatedExpression
numberBasicEvaluatedExpressionSet's the value of this expression to a number
setOptions(options): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionStores the options of a conditional expression.
setRange(range): BasicEvaluatedExpression
BasicEvaluatedExpressionSet's the range for the expression.
setRegExp(regExp): BasicEvaluatedExpression
RegExpBasicEvaluatedExpressionSet's the value of this expression to a regular expression
setSideEffects(sideEffects?): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet whether or not the expression has side effects.
setString(string): BasicEvaluatedExpression
stringBasicEvaluatedExpressionUpdates string using the provided string.
setTemplateString(quasis, parts, kind): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpression[]"cooked" | "raw"BasicEvaluatedExpressionSet's the value of this expression to a processed/unprocessed template string. Used for evaluating TemplateLiteral expressions in the JavaScript Parser.
setTruthy(): BasicEvaluatedExpression
BasicEvaluatedExpressionsetUndefined(): BasicEvaluatedExpression
BasicEvaluatedExpressionsetWrapped(prefix?, postfix?, innerExpressions?): BasicEvaluatedExpression
BasicEvaluatedExpression | nullBasicEvaluatedExpression | nullBasicEvaluatedExpression[]BasicEvaluatedExpressionWraps an array of expressions with a prefix and postfix expression.