diff --git a/execjs-pcruntime.gemspec b/execjs-pcruntime.gemspec index 75bb5f8..6ee04d9 100644 --- a/execjs-pcruntime.gemspec +++ b/execjs-pcruntime.gemspec @@ -14,6 +14,7 @@ Gem::Specification.new do |spec| spec.license = 'MIT' spec.add_dependency 'execjs', '~> 2.0' + spec.add_dependency 'json', '>= 2.0' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. diff --git a/lib/execjs/pcruntime/context_process_runtime.rb b/lib/execjs/pcruntime/context_process_runtime.rb index e968692..206c17e 100644 --- a/lib/execjs/pcruntime/context_process_runtime.rb +++ b/lib/execjs/pcruntime/context_process_runtime.rb @@ -221,7 +221,7 @@ def post_request(socket_path, path, content_type = nil, body = nil) result = URI.decode_www_form_component response.body if response.code == '200' - ::JSON.parse(result, create_additions: false) if /\S/.match?(result) + ::JSON.parse(result) if /\S/.match?(result) else # expects ErrorMessage\0StackTrace =~ response.body message, stack = result.split "\0" diff --git a/test/test_execjs.rb b/test/test_execjs.rb index 061e3cf..17a240a 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -170,10 +170,10 @@ def test_context_call_missing_function { 'a' => 1, 'b' => [2, 3] }, { 'a' => true } ].each_with_index do |value, index| - json_value = JSON.generate(value, quirks_mode: true) + json_value = JSON.generate(value) define_method("test_json_value_#{index}") do - assert_output value, JSON.parse(json_value, quirks_mode: true) + assert_output value, JSON.parse(json_value) end define_method("test_exec_value_#{index}") do