xk/JASON

Round-trip failure

Closed this issue · 1 comments

I would have expected that a simple round-trip would work, but it fails for me on Node.js 0.6.10 and 0.4.12. For example:

$ node -e "var J = require('JASON');J.parse(J.stringify(J));"

undefined:1

^
SyntaxError: Unexpected token :
    at Object.parse (/Users/mfncooper/dev/test/node_modules/JASON/index.js:269:17)
    at Object.<anonymous> (eval at <anonymous> (eval:1:82))
    at Object.<anonymous> (eval:1:70)
    at Module._compile (module.js:441:26)
    at startup (node.js:80:27)
    at node.js:551:3
xk commented

Ooops, sorry, my bad.

I forgot to wrap with parens to disambiguate a block from an object literal.

Fixed in 3696a33.