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:
commit
4d6fe5f138
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ module ExecJS
|
||||||
source = encode(source)
|
source = encode(source)
|
||||||
|
|
||||||
if /\S/ =~ source
|
if /\S/ =~ source
|
||||||
exec("return eval(#{::JSON.dump("(#{source})")})")
|
exec("return eval(#{::JSON.generate("(#{source})", :quirks_mode => true)})")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue