empty regular expressions with flags still need to be compiled to /(?:)/

This commit is contained in:
Michael Ficarra
2011-10-03 03:47:24 -04:00
parent 1627922060
commit 9fef66ffcf
3 changed files with 18 additions and 12 deletions

View File

@@ -55,3 +55,9 @@ test "an empty heregex will compile to an empty, non-capturing group", ->
test "#1724: regular expressions beginning with `*`", ->
throws -> CoffeeScript.compile '/// * ///'
test "empty regular expressions with flags", ->
fn = (x) -> x
a = "" + //i
fn ""
eq '/(?:)/i', a