add empty replace test

This commit is contained in:
Aleksey Shvayka 2017-06-26 18:57:19 +03:00
parent cb22dad417
commit f7b15e18d4
1 changed files with 2 additions and 0 deletions

View File

@ -21,4 +21,6 @@ for (let flags of ["", "u", "g", "gu"]) {
let re = new RegExp(source, flags);
assert.throws(SyntaxError, () => "abcd".replace(re, "$<snd"),
"unclosed named group in replacement should throw a SyntaxError");
assert.throws(SyntaxError, () => "abcd".replace(re, "$<>"),
"empty named group in replacement should throw a SyntaxError");
}