Run following code, will raise an Error: "Unexpected token ILLEGAL" `require("vm").runInThisContext("var b = '\u2029' ")`
Activity
targos commentedon Oct 28, 2015
I guess you have to escape the backslash so it stays as-is in the string passed to
runInThisContextalexeyten commentedon Oct 28, 2015
You could get the same error with simple
\nin place of\u2029. That's because they both are line terminators. See good article http://timelessrepo.com/json-isnt-a-javascript-subsetflyingfisher commentedon Oct 28, 2015
Yes. Thanks a lot.
This is exactly what I need. And I do think JSON is a subset of javascript.
Now I get it, thanks.