1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Merge pull request #130 from ixti/patch-1

Use JSON.generate to properly quote JS string
This commit is contained in:
Joshua Peek 2013-08-27 08:02:58 -07:00
commit 4d6fe5f138

View file

@ -16,7 +16,7 @@ module ExecJS
source = encode(source)
if /\S/ =~ source
exec("return eval(#{::JSON.dump("(#{source})")})")
exec("return eval(#{::JSON.generate("(#{source})", :quirks_mode => true)})")
end
end