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

don't fail on unicode js newlines (\u2028, \u2029) when using -O with a JSON string #1949

Closed
jurriaan opened this issue May 14, 2015 · 2 comments

Comments

@jurriaan
Copy link

SyntaxError: Unexpected token ILLEGAL
    at parseObj (/usr/local/lib/node_modules/jade/bin/jade.js:77:35)
    at Object.<anonymous> (/usr/local/lib/node_modules/jade/bin/jade.js:65:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

This is because of the eval in https://github.com/jadejs/jade/blob/master/bin/jade.js#L78. Instead of eval the object should be parsed using JSON.parse.

@ForbesLindesay
Copy link
Member

The downside is that using JSON.parse does not support nearly as much functionality as eval does.

@ForbesLindesay
Copy link
Member

Moving to jade-cli

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

2 participants