Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
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("").
Attachments
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 -
| Attachment | 0001-CLJS-471-prevent-empty-regexps-from-causing-compiler.patch [ 11945 ] |
Michał Marczyk
made changes -
| Assignee | Michał Marczyk [ michalmarczyk ] |
Commit message:
CLJS-471: prevent empty regexps from causing compiler errors This patch chooses to emit (new RegExp("")) rather than /(?:)/ so that (pr-str #"") returns "#\"\"" rather than "#\"(?:)\"" A test for the above is included.CLJS-471: prevent empty regexps from causing compiler errors This patch chooses to emit (new RegExp("")) rather than /(?:)/ so that (pr-str #"") returns "#\"\"" rather than "#\"(?:)\"" A test for the above is included.