Skip to content

Commit 60755c1

Browse files
jviottiJuan Cruz Viotti
andauthored
Fix Draft 3 ecmascript-regex look-behind test (#906)
Lookbehind assertions were added to ECMA-262 in ES2018 and are accepted by every modern JavaScript engine, so "(?<=foo)bar" is in fact a valid ECMA 262 regex. The existing test asserting otherwise no longer reflects the specification. I know we discourage work on older drafts but bear with me! I need good Draft 3 support for my auto-upgrades :) Signed-off-by: Juan Cruz Viotti <jv@jviotti.com> Co-authored-by: Juan Cruz Viotti <jviotti@sourcemeta.com>
1 parent e3525a5 commit 60755c1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/draft3/optional/format/ecmascript-regex.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
"valid": true
1010
},
1111
{
12-
"description": "ECMA 262 has no support for lookbehind",
12+
"description": "ECMA 262 supports lookbehind since ES2018",
1313
"data": "(?<=foo)bar",
14+
"valid": true
15+
},
16+
{
17+
"description": "ECMA 262 does not support Python-style named groups",
18+
"data": "(?P<name>x)",
1419
"valid": false
1520
}
1621
]

0 commit comments

Comments
 (0)