Repository navigation
Commit 426aad3
committed
fix(dependencies): keep context matcher valid under Unicode flags
Preserving the user's `wrappedContextRegExp` flags means `u`/`v` can now
reach the rebuilt matcher. `quoteMeta` escaped `-` as `\-`, which is an
invalid escape outside a character class in Unicode mode, so a request
with a literal `-` in its static prefix or postfix (for example
importing a template literal like ./dir/module-${x}.js) threw and
aborted the build. `-` is a literal outside `[...]` and the quoted
string is only ever concatenated between anchors, so leave it unescaped.
Covers both the wrapped-context (template-literal) and wrapped-expression
(concatenation) paths with Unicode-mode, hyphen-in-prefix cases.
Signed-off-by: Eshiv Pandey <[email protected]>1 parent f3e01c0 commit 426aad3
3 files changed
Lines changed: 28 additions & 5 deletions
File tree
- lib/dependencies/context
- test/configCases/context-modules/wrapped-context-regexp-flags
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
30 | | - | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
0 commit comments