Module Expr

Provides classes for working with expressions.

Import path

import semmle.javascript.Expr

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Classes

AddExpr

An addition or string-concatenation expression.

ArithmeticExpr

A binary arithmetic expression using +, -, /, % or **.

ArrayComprehensionExpr

An array comprehension expression.

ArrayExpr

An array literal.

ArrowFunctionExpr

An arrow function expression.

AssignAddExpr

A compound add-assign expression.

AssignAndExpr

A compound bitwise-‘and’-assign expression.

AssignDivExpr

A compound divide-assign expression.

AssignExpExpr

A compound exponentiate-assign expression.

AssignExpr

A simple assignment expression.

AssignLShiftExpr

A compound left-shift-assign expression.

AssignModExpr

A compound modulo-assign expression.

AssignMulExpr

A compound multiply-assign expression.

AssignOrExpr

A compound bitwise-‘or’-assign expression.

AssignRShiftExpr

A compound right-shift-assign expression.

AssignSubExpr

A compound subtract-assign expression.

AssignURShiftExpr

A compound unsigned-right-shift-assign expression.

AssignXOrExpr

A compound exclusive-‘or’-assign expression.

Assignment

An assignment expression, either compound or simple.

AwaitExpr

An await expression.

BigIntLiteral

A BigInt literal.

BinaryExpr

An expression with a binary operator.

BitAndExpr

A bitwise ‘and’ expression.

BitNotExpr

A bitwise negation expression.

BitOrExpr

A bitwise ‘or’ expression.

BitwiseBinaryExpr

A bitwise binary expression, that is, either a bitwise ‘and’, a bitwise ‘or’, or an exclusive ‘or’ expression.

BitwiseExpr

A bitwise expression using &, |, ^, ~, <<, >>, or >>>.

BooleanLiteral

A Boolean literal, that is, either true or false.

CallExpr

A function call expression.

Comparison

A comparison expression, that is, either an equality test (==, !=, ===, !==) or a relational expression (<, <=, >=, >).

CompoundAssignExpr

A compound assign expression.

ComprehensionBlock

A comprehension block in a comprehension expression.

ComprehensionExpr

A comprehension expression, that is, either an array comprehension expression or a generator expression.

ConditionalExpr

A conditional expression.

DecExpr

A (pre or post) decrement expression.

Decoratable

A program element to which decorators can be applied, that is, a class, a property or a member definition.

Decorator

A decorator applied to a class, property or member definition.

DeleteExpr

A delete expression.

DivExpr

A division expression.

DotExpr

A dot expression.

DynamicImportExpr

A dynamic import expression.

EqExpr

An equality test using ==.

EqualityTest

An equality test using ==, !=, === or !==.

ExpExpr

An exponentiation expression.

Expr

An expression.

ExprOrType

A program element that is either an expression or a type annotation.

ForInComprehensionBlock

A for-in comprehension block in a comprehension expression.

ForOfComprehensionBlock

A for-of comprehension block in a comprehension expression.

FunctionBindExpr

A function-bind expression.

FunctionExpr

A (non-arrow) function expression.

FunctionSentExpr

A function.sent expression.

GEExpr

A greater-than-or-equal expression.

GTExpr

A greater-than expression.

GeneratorExpr

A generator expression.

Identifier

An identifier.

ImmediatelyInvokedFunctionExpr

An immediately invoked function expression (IIFE).

ImportMetaExpr

An import.meta expression.

InExpr

An in expression.

IncExpr

A (pre or post) increment expression.

IndexExpr

An index expression (also known as computed property access).

InstanceofExpr

An instanceof expression.

InvokeExpr

An invocation expression, that is, either a function call or a new expression.

LEExpr

A less-than-or-equal expression.

LShiftExpr

A left-shift expression using <<.

LTExpr

A less-than expression.

Label

A statement or property label, that is, an identifier that does not refer to a variable.

LegacyLetExpr

An old-style let expression of the form let(vardecls) expr.

Literal

A literal.

LogAndExpr

A logical ‘and’ expression.

LogNotExpr

A logical negation expression.

LogOrExpr

A logical ‘or’ expression.

LogicalBinaryExpr

A short-circuiting logical binary expression, that is, a logical ‘or’ expression, a logical ‘and’ expression, or a nullish-coalescing expression.

LogicalExpr

A logical expression using &&, ||, or !.

MethodCallExpr

A method call expression.

ModExpr

A modulo expression.

MulExpr

A multiplication expression.

NEqExpr

An inequality test using !=.

NegExpr

An arithmetic negation expression (also known as unary minus).

NewExpr

A new expression.

NonStrictEqualityTest

A non-strict equality test using != or ==.

NullLiteral

A null literal.

NullishCoalescingExpr

A nullish coalescing ‘??’ expression.

NumberLiteral

A numeric literal.

ObjectExpr

An object literal, containing zero or more property definitions.

OptionalChainRoot

INTERNAL: This class should not be used by queries.

OptionalUse

A call or member access that evaluates to undefined if its base operand evaluates to undefined or null.

ParExpr

A parenthesized expression.

PlusExpr

A unary plus expression.

PostDecExpr

A postfix decrement expression.

PostIncExpr

A postfix increment expression.

PreDecExpr

A prefix decrement expression.

PreIncExpr

A prefix increment expression.

PropAccess

A property access, that is, either a dot expression of the form e.f or an index expression of the form e[p].

Property

A property definition in an object literal, which may be either a value property, a property getter, or a property setter.

PropertyAccessor

A property getter or setter in an object literal.

PropertyGetter

A property getter in an object literal.

PropertySetter

A property setter in an object literal.

RShiftExpr

A right-shift expression using >>.

RegExpLiteral

A regular expression literal.

RelationalComparison

A relational comparison using <, <=, >=, or >.

SeqExpr

A sequence expression (also known as comma expression).

ShiftExpr

A shift expression.

SpreadElement

A spread element.

SpreadProperty

A spread property in an object literal.

StrictEqExpr

A strict equality test using ===.

StrictEqualityTest

A strict equality test using !== or ===.

StrictNEqExpr

A strict inequality test using !==.

StringLiteral

A string literal, either single-quoted or double-quoted.

SubExpr

A subtraction expression.

ThisExpr

A this expression.

TypeofExpr

A typeof expression.

URShiftExpr

An unsigned right-shift expression using >>>.

UnaryExpr

An expression with a unary operator.

UpdateExpr

An update expression, that is, an increment or decrement expression.

ValueProperty

A value property definition in an object literal.

VoidExpr

A void expression.

XOrExpr

An exclusive ‘or’ expression.

YieldExpr

A yield expression.