Skip to content
Snippets Groups Projects
Commit f7b15e18 authored by Aleksey Shvayka's avatar Aleksey Shvayka
Browse files

add empty replace test

parent cb22dad4
No related branches found
No related tags found
No related merge requests found
...@@ -21,4 +21,6 @@ for (let flags of ["", "u", "g", "gu"]) { ...@@ -21,4 +21,6 @@ for (let flags of ["", "u", "g", "gu"]) {
let re = new RegExp(source, flags); let re = new RegExp(source, flags);
assert.throws(SyntaxError, () => "abcd".replace(re, "$<snd"), assert.throws(SyntaxError, () => "abcd".replace(re, "$<snd"),
"unclosed named group in replacement should throw a SyntaxError"); "unclosed named group in replacement should throw a SyntaxError");
assert.throws(SyntaxError, () => "abcd".replace(re, "$<>"),
"empty named group in replacement should throw a SyntaxError");
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment