|
1 | 1 | // We must load the CJS version here because the ESM wrapper call `hasIPv6` |
2 | 2 | // which compiles a RegEx. |
3 | 3 | // eslint-disable-next-line node-core/require-common-first |
4 | | -import '../common/index.js'; |
| 4 | +import common from '../common/index.js'; |
5 | 5 | import assert from 'node:assert'; |
6 | 6 |
|
7 | | -assert.strictEqual(RegExp.$_, ''); |
8 | | -assert.strictEqual(RegExp.$0, undefined); |
9 | | -assert.strictEqual(RegExp.$1, ''); |
10 | | -assert.strictEqual(RegExp.$2, ''); |
11 | | -assert.strictEqual(RegExp.$3, ''); |
12 | | -assert.strictEqual(RegExp.$4, ''); |
13 | | -assert.strictEqual(RegExp.$5, ''); |
14 | | -assert.strictEqual(RegExp.$6, ''); |
15 | | -assert.strictEqual(RegExp.$7, ''); |
16 | | -assert.strictEqual(RegExp.$8, ''); |
17 | | -assert.strictEqual(RegExp.$9, ''); |
18 | | -assert.strictEqual(RegExp.input, ''); |
19 | | -assert.strictEqual(RegExp.lastMatch, ''); |
20 | | -assert.strictEqual(RegExp.lastParen, ''); |
21 | | -assert.strictEqual(RegExp.leftContext, ''); |
22 | | -assert.strictEqual(RegExp.rightContext, ''); |
23 | | -assert.strictEqual(RegExp['$&'], ''); |
24 | | -assert.strictEqual(RegExp['$`'], ''); |
25 | | -assert.strictEqual(RegExp['$+'], ''); |
26 | | -assert.strictEqual(RegExp["$'"], ''); |
| 7 | +if (!common.isInsideCWDWithUnusualChars) { |
| 8 | + assert.strictEqual(RegExp.$_, ''); |
| 9 | + assert.strictEqual(RegExp.$0, undefined); |
| 10 | + assert.strictEqual(RegExp.$1, ''); |
| 11 | + assert.strictEqual(RegExp.$2, ''); |
| 12 | + assert.strictEqual(RegExp.$3, ''); |
| 13 | + assert.strictEqual(RegExp.$4, ''); |
| 14 | + assert.strictEqual(RegExp.$5, ''); |
| 15 | + assert.strictEqual(RegExp.$6, ''); |
| 16 | + assert.strictEqual(RegExp.$7, ''); |
| 17 | + assert.strictEqual(RegExp.$8, ''); |
| 18 | + assert.strictEqual(RegExp.$9, ''); |
| 19 | + assert.strictEqual(RegExp.input, ''); |
| 20 | + assert.strictEqual(RegExp.lastMatch, ''); |
| 21 | + assert.strictEqual(RegExp.lastParen, ''); |
| 22 | + assert.strictEqual(RegExp.leftContext, ''); |
| 23 | + assert.strictEqual(RegExp.rightContext, ''); |
| 24 | + assert.strictEqual(RegExp['$&'], ''); |
| 25 | + assert.strictEqual(RegExp['$`'], ''); |
| 26 | + assert.strictEqual(RegExp['$+'], ''); |
| 27 | + assert.strictEqual(RegExp["$'"], ''); |
| 28 | +} |
0 commit comments