Repository navigation
Commit 03f0ad5
Radu Samson
deps: V8: cherry-pick 1e7ee91de775
Original commit message:
[regexp] Reset flags between negative lookaround branches
e540e1161b0 (bug 510487690) reset the analysis-time flags between the
alternatives of a ChoiceNode, since an alternative's sub-graph may
contain a MODIFY_FLAGS node. NegativeLookaroundChoiceNode has its own
visitor and was left out, so a modifier group inside a negative
lookaround still leaks its flags into the continuation.
/(?!(?i:x|y))[K]/.exec('kz') // "k", should be null
The lookaround body is visited first and leaves the group's flags
behind; the continuation's class ranges are then made case independent
under those flags rather than the pattern's, so [K] picks up 'k'.
Only class ranges are affected: TextNode::MakeCaseIndependent
materializes the equivalents during analysis, while atoms get their case
closure at emission time from the restored flags. A single- alternative
body does not reproduce either, since its restore node is emitted last.
Change-Id: I4077076b9dbee6acf75918a2c4f7bf7d86cab059
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8175612
Auto-Submit: Jakob Linke <[email protected]>
Reviewed-by: Patrick Thier <[email protected]>
Commit-Queue: Patrick Thier <[email protected]>
Cr-Commit-Position: refs/heads/main@{#109043}
Adjusted for the V8 version in deps: use RegExpFlags instead of the
Flags alias, which does not exist there.
Refs: v8/v8@1e7ee91
Refs: nodejs#66277
Assisted-by: Claude Code
Signed-off-by: Radu Samson <[email protected]>1 parent 380afb0 commit 03f0ad5
3 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3889 | 3889 | | |
3890 | 3890 | | |
3891 | 3891 | | |
| 3892 | + | |
3892 | 3893 | | |
3893 | 3894 | | |
3894 | 3895 | | |
3895 | 3896 | | |
3896 | 3897 | | |
| 3898 | + | |
3897 | 3899 | | |
3898 | 3900 | | |
3899 | 3901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
0 commit comments