Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ternary operator with undefined variables #13

Open
GoogleCodeExporter opened this issue Mar 4, 2016 · 1 comment
Open

Ternary operator with undefined variables #13

GoogleCodeExporter opened this issue Mar 4, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

<%= message ? message : 'No message' %>

When the variable message === undefined, the compiler throws an exception, even 
though a regular IF statement should just evaluate the expression to FALSE.

By the way, this executes correctly:

<%= typeof message != 'undefined' ? message : 'No message' %>


I am using the ejs_1.0_developer release (downloaded two days ago) as a Node.js 
module. [Cygwin environment running on Windows 7]

Original issue reported on code.google.com by yannis.k...@gmail.com on 20 Dec 2010 at 7:11

@GoogleCodeExporter
Copy link
Author

Sorry for the double-post. Google threw a 502 Server Error at me on posting so 
I refreshed the page thinking it was not posted the first time.

Original comment by yannis.k...@gmail.com on 20 Dec 2010 at 7:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant