Browse Source

Bug test for invalid RegExp group, e.g. (?X...)

pull/1463/head
Sami Vaarala 8 years ago
parent
commit
476c01b546
  1. 25
      tests/ecmascript/test-bug-regexp-noncapturing-parse.js

25
tests/ecmascript/test-bug-regexp-noncapturing-parse.js

@ -0,0 +1,25 @@
/*
* This test from https://github.com/kangax/compat-table succeeds but
* should fail.
*/
/*===
SyntaxError
SyntaxError
===*/
try {
var t = eval('/(?P<name>a)(?P=name)/');
print(t);
print(t.test("aa"));
} catch (e) {
print(e.name);
}
try {
// In General '(?' followed by something else than ':' is a SyntaxError.
var t = eval('/(?X)/');
print(t);
} catch (e) {
print(e.name);
}
Loading…
Cancel
Save