ClojureScript

Empty regexp causes Closure Compiler error

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

An empty regexp of the form #"" compiles to //, which is not an empty regexp but a comment, causing the code following the supposed regexp on the affected line to be commented out. This tends to cause compiler errors when Closure Compiler tries to parse it.

#"" should instead produce either /(?:)/ or new RegExp("").

Activity

Bodil Stokke made changes -
Field Original Value New Value
Description An empty regexp of the form {{#""}} compiles to {{//}}, which is not an empty regexp but a comment, causing the code following the supposed regexp on the affected line to be commented out. This tends to cause compiler errors when Closure Compiler tries to parse it.

{{#""}} should instead produce either {{/(?:)/}} or {{new RegExp("")}}.
An empty regexp of the form {{#""}} compiles to {{//}}, which is not an empty regexp but a comment, causing the code following the supposed regexp on the affected line to be commented out. This tends to cause compiler errors when Closure Compiler tries to parse it.

{{#""}} should instead produce either {{/(?:\)/}} or {{new RegExp("")}}.
Michał Marczyk made changes -
Michał Marczyk made changes -
Assignee Michał Marczyk [ michalmarczyk ]
Chas Emerick made changes -
Attachment CLJS-471-2.diff [ 12354 ]
Chas Emerick made changes -
Patch Code and Test [ 10002 ]
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: