ejs icon indicating copy to clipboard operation
ejs copied to clipboard

";" in <%- %> or <%= %> creates a SyntaxError

Open der-On opened this issue 11 years ago • 1 comments

When using a regular ";" within <%- %> or <%= %> block ejs throws a SyntaxError. As this is valid JS Syntax it should not.

Failing example:

<%- "foo"; %>

Working example:

<%- "foo" %>

der-On avatar Jan 09 '14 01:01 der-On

First, it should throw an error, as <%- and <%= are supposed to be JavaScript expressions not statements.

Second, in EJS v2 (mde/ejs) we have loosened this requirement. In my fork of @tj's EJS with EJS v2 features but EJS v1 performance (TimothyGu/ejs) I have also loosened the requirement.

TimothyGu avatar Jan 24 '15 20:01 TimothyGu