Skip to main content

Function: isRepeatablyEvaluableExpression()

isRepeatablyEvaluableExpression(node: Readonly<PrivateIdentifier | Expression>): node is Expression

Defined in: _internal/value-rewrite-autofix-safety.ts:114

Determine whether an expression is safe to evaluate fewer times after a rewrite that collapses duplicate evaluations.

Parametersโ€‹

nodeโ€‹

Readonly<PrivateIdentifier | Expression>

Returnsโ€‹

node is Expression

Remarksโ€‹

Expressions such as member access or function calls can change runtime behavior when duplicated evaluation sites are rewritten to a single helper call. This helper intentionally accepts only stable, exception-free primitives and identifiers.