Skip to content

Commit

Permalink
Fix infinite loop in v-flag regexp validation
Browse files Browse the repository at this point in the history
Issue #1221
  • Loading branch information
marijnh committed Jun 16, 2023
1 parent 3d90580 commit 8906b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acorn/src/regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ pp.regexp_eatClassSetCharacter = function(state) {
return false
}
const ch = state.current()
if (ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) return false
if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) return false
if (isClassSetSyntaxCharacter(ch)) return false
state.advance()
state.lastIntValue = ch
Expand Down

0 comments on commit 8906b82

Please sign in to comment.