From f6807af2cf740d1348c7d4d165d0473bcdeb2328 Mon Sep 17 00:00:00 2001 From: "Aleksey V. Zapparov" Date: Fri, 23 Aug 2013 16:34:19 +0200 Subject: [PATCH] Use JSON.generate to properly quote JS string --- lib/execjs/external_runtime.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb index 469cc3d..875c3b2 100644 --- a/lib/execjs/external_runtime.rb +++ b/lib/execjs/external_runtime.rb @@ -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