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 | VariableDeclaratorbooleanbasicEvaluatedExpression.getMemberRanges(): [number, number][]
basicEvaluatedExpression.getMembers(): string[]
string[]basicEvaluatedExpression.getMembersOptionals(): boolean[]
boolean[]string | VariableInfoBasicEvaluatedExpression[]booleannumberBasicEvaluatedExpression[]BasicEvaluatedExpression[]BasicEvaluatedExpression | nullBasicEvaluatedExpression | nullBasicEvaluatedExpression[]Served lazily from the attached expression when not set explicitly:
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[]basicEvaluatedExpression.addOptions(options): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionAdds the provided basic evaluated expression to the basic evaluated expression.
basicEvaluatedExpression.asBool(): boolean | undefined
Creates a boolean representation of this evaluated expression.
basicEvaluatedExpression.asCompileTimeValue(): string | number | bigint | boolean | RegExp | any[] | null | undefined
As compile time value.
basicEvaluatedExpression.asNullish(): boolean | undefined
Creates a nullish coalescing representation of this evaluated expression.
basicEvaluatedExpression.asString(): string | undefined
Creates a string representation of this evaluated expression.
basicEvaluatedExpression.couldHaveSideEffects(): boolean
booleanCan this expression have side effects?
basicEvaluatedExpression.isArray(): boolean
booleanbasicEvaluatedExpression.isBigInt(): boolean
booleanbasicEvaluatedExpression.isBoolean(): boolean
booleanbasicEvaluatedExpression.isCompileTimeValue(): boolean
booleanIs expression a runtime or compile-time value?
basicEvaluatedExpression.isConditional(): boolean
booleanbasicEvaluatedExpression.isConstArray(): boolean
booleanbasicEvaluatedExpression.isFalsy(): boolean
booleanbasicEvaluatedExpression.isIdentifier(): boolean
booleanbasicEvaluatedExpression.isNull(): boolean
booleanbasicEvaluatedExpression.isNullish(): boolean | undefined
basicEvaluatedExpression.isNumber(): boolean
booleanbasicEvaluatedExpression.isPrimitiveType(): boolean | undefined
Is expression a primitive or an object type value?
basicEvaluatedExpression.isRegExp(): boolean
booleanbasicEvaluatedExpression.isString(): boolean
booleanbasicEvaluatedExpression.isTemplateString(): boolean
booleanbasicEvaluatedExpression.isTruthy(): boolean
booleanbasicEvaluatedExpression.isUndefined(): boolean
booleanbasicEvaluatedExpression.isUnknown(): boolean
booleanbasicEvaluatedExpression.isWrapped(): boolean
booleanbasicEvaluatedExpression.setArray(array): BasicEvaluatedExpression
string[]BasicEvaluatedExpressionSet's the value of this expression to an array of strings.
basicEvaluatedExpression.setBigInt(bigint): BasicEvaluatedExpression
bigintBasicEvaluatedExpressionSet's the value of this expression to a BigInt
basicEvaluatedExpression.setBoolean(bool): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet's the value of this expression to a boolean
basicEvaluatedExpression.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.
basicEvaluatedExpression.setFalsy(): BasicEvaluatedExpression
BasicEvaluatedExpressionbasicEvaluatedExpression.setIdentifier(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.
basicEvaluatedExpression.setItems(items): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionSet's the value of this expression to an array of expressions.
basicEvaluatedExpression.setNull(): BasicEvaluatedExpression
BasicEvaluatedExpressionbasicEvaluatedExpression.setNullish(value): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet's the value of the expression to nullish.
basicEvaluatedExpression.setNumber(number): BasicEvaluatedExpression
numberBasicEvaluatedExpressionSet's the value of this expression to a number
basicEvaluatedExpression.setOptions(options): BasicEvaluatedExpression
BasicEvaluatedExpression[]BasicEvaluatedExpressionStores the options of a conditional expression.
basicEvaluatedExpression.setRange(range): BasicEvaluatedExpression
BasicEvaluatedExpressionSet's the range for the expression.
basicEvaluatedExpression.setRegExp(regExp): BasicEvaluatedExpression
RegExpBasicEvaluatedExpressionSet's the value of this expression to a regular expression
basicEvaluatedExpression.setSideEffects(sideEffects?): BasicEvaluatedExpression
booleanBasicEvaluatedExpressionSet whether or not the expression has side effects.
basicEvaluatedExpression.setString(string): BasicEvaluatedExpression
stringBasicEvaluatedExpressionUpdates string using the provided string.
basicEvaluatedExpression.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.
basicEvaluatedExpression.setTruthy(): BasicEvaluatedExpression
BasicEvaluatedExpressionbasicEvaluatedExpression.setUndefined(): BasicEvaluatedExpression
BasicEvaluatedExpressionbasicEvaluatedExpression.setWrapped(prefix?, postfix?, innerExpressions?): BasicEvaluatedExpression
BasicEvaluatedExpression | nullBasicEvaluatedExpression | nullBasicEvaluatedExpression[]BasicEvaluatedExpressionWraps an array of expressions with a prefix and postfix expression.