Skip to content

Commit

Permalink
Found a crash and fixed it
Browse files Browse the repository at this point in the history
  • Loading branch information
markwpearce committed Nov 29, 2024
1 parent 346e205 commit b1d7d72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2256,12 +2256,12 @@ export class Util {
public isInTypeExpression(expression: AstNode): boolean {
//TODO: this is much faster than node.findAncestor(), but may need to be updated for "complicated" type expressions
if (isTypeExpression(expression) ||
isTypeExpression(expression.parent) ||
isTypeExpression(expression?.parent) ||
isTypedArrayExpression(expression) ||
isTypedArrayExpression(expression.parent)) {
isTypedArrayExpression(expression?.parent)) {
return true;
}
if (isBinaryExpression(expression.parent)) {
if (isBinaryExpression(expression?.parent)) {
let currentExpr: AstNode = expression.parent;
while (isBinaryExpression(currentExpr) && currentExpr.tokens.operator.kind === TokenKind.Or) {
currentExpr = currentExpr.parent;
Expand Down

0 comments on commit b1d7d72

Please sign in to comment.