I thought about this, but the thing is that without quirks mode whole test suite fails. To demonstrate this, you can replace `json_encode` with `::JSON.dump` in external runner, with sed and run specs. Here's specs running on my laptop with this PR:

```
% ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]

% rake
===============================================================================================================================================================================================
Running test:javascriptcore
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
JavaScriptCore runtime is not available on this system

===============================================================================================================================================================================================
Running test:jscript
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
JScript runtime is not available on this system

===============================================================================================================================================================================================
Running test:node
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
Run options: 

# Running tests:

..................

Finished tests in 3.613903s, 4.9808 tests/s, 17.4327 assertions/s.

18 tests, 63 assertions, 0 failures, 0 errors, 0 skips

===============================================================================================================================================================================================
Running test:rubyracer
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/init.so: warning: method redefined; discarding old IntegerValue
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:43: warning: assigned but unused variable - trace_framework
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:69: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:74: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:64: warning: assigned but unused variable - backtrace
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:16: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:27: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:31: warning: `*' interpreted as argument prefix
Run options: 

# Running tests:

..................

Finished tests in 1.045634s, 17.2144 tests/s, 60.2506 assertions/s.

18 tests, 63 assertions, 0 failures, 0 errors, 0 skips

===============================================================================================================================================================================================
Running test:rubyrhino
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
therubyrhino (Rhino) runtime is not available on this system

===============================================================================================================================================================================================
PASSED:  test:node, test:rubyracer
SKIPPED: test:javascriptcore, test:jscript, test:rubyrhino
===============================================================================================================================================================================================

```

And here's with `json_encode` being replaced with `JSON.dump`


```
% sed -i '/^ *def/! s/json_encode/::JSON.dump/' lib/execjs/external_runtime.rb

% git diff | cat
diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb
index dd5b73d..0dedc92 100644
--- a/lib/execjs/external_runtime.rb
+++ b/lib/execjs/external_runtime.rb
@@ -17,7 +17,7 @@ module ExecJS
         source = encode(source)
 
         if /\S/ =~ source
-          exec("return eval(#{json_encode("(#{source})")})")
+          exec("return eval(#{::JSON.dump("(#{source})")})")
         end
       end
 
@@ -31,7 +31,7 @@ module ExecJS
       end
 
       def call(identifier, *args)
-        eval "#{identifier}.apply(this, #{json_encode(args)})"
+        eval "#{identifier}.apply(this, #{::JSON.dump(args)})"
       end
 
       protected
@@ -51,7 +51,7 @@ module ExecJS
             end
             output.sub!('#{encoded_source}') do
               encoded_source = encode_unicode_codepoints(source)
-              json_encode("(function(){ #{encoded_source} })()")
+              ::JSON.dump("(function(){ #{encoded_source} })()")
             end
             output.sub!('#{json2_source}') do
               IO.read(ExecJS.root + "/support/json2.js")

% rake
===============================================================================================================================================================================================
Running test:javascriptcore
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
JavaScriptCore runtime is not available on this system

===============================================================================================================================================================================================
Running test:jscript
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
JScript runtime is not available on this system

===============================================================================================================================================================================================
Running test:node
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
Run options: 

# Running tests:

EEE.EEFEEE..E...E.

Finished tests in 2.024546s, 8.8909 tests/s, 14.8181 assertions/s.

  1) Error:
test_coffeescript(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:34:in `call'
    /home/ixti/Projects/execjs/test/test_execjs.rb:167:in `test_coffeescript'

  2) Error:
test_commonjs_vars_are_undefined(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/runtime.rb:40:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/module.rb:23:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:137:in `test_commonjs_vars_are_undefined'

  3) Error:
test_compile(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:127:in `test_compile'

  4) Error:
test_console_is_undefined(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/runtime.rb:40:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/module.rb:23:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:143:in `test_console_is_undefined'

  5) Error:
test_context_call(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:34:in `call'
    /home/ixti/Projects/execjs/test/test_execjs.rb:36:in `test_context_call'

  6) Failure:
test_context_call_missing_function(TestExecJS) [/home/ixti/Projects/execjs/test/test_execjs.rb:46]:
[ExecJS::ProgramError] exception expected, not
Class: <JSON::GeneratorError>
Message: <"only generation of JSON objects or arrays allowed">
---Backtrace---
/home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
/home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:34:in `call'
/home/ixti/Projects/execjs/test/test_execjs.rb:47:in `block in test_context_call_missing_function'
/home/ixti/Projects/execjs/test/test_execjs.rb:46:in `test_context_call_missing_function'
---------------

  7) Error:
test_encoding(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/runtime.rb:40:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/module.rb:23:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:91:in `test_encoding'

  8) Error:
test_encoding_compile(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:110:in `test_encoding_compile'

  9) Error:
test_eval(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/runtime.rb:40:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/module.rb:23:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:70:in `test_eval'

 10) Error:
test_nested_context_call(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:34:in `call'
    /home/ixti/Projects/execjs/test/test_execjs.rb:41:in `test_nested_context_call'

 11) Error:
test_this_is_global_scope(TestExecJS):
JSON::GeneratorError: only generation of JSON objects or arrays allowed
    /home/ixti/Projects/execjs/lib/execjs/external_runtime.rb:20:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/runtime.rb:40:in `eval'
    /home/ixti/Projects/execjs/lib/execjs/module.rb:23:in `eval'
    /home/ixti/Projects/execjs/test/test_execjs.rb:132:in `test_this_is_global_scope'

18 tests, 30 assertions, 1 failures, 10 errors, 0 skips

===============================================================================================================================================================================================
Running test:rubyracer
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/init.so: warning: method redefined; discarding old IntegerValue
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:43: warning: assigned but unused variable - trace_framework
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:69: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:74: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/error.rb:64: warning: assigned but unused variable - backtrace
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:16: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:27: warning: `*' interpreted as argument prefix
/home/ixti/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.0/lib/v8/access/invocation.rb:31: warning: `*' interpreted as argument prefix
Run options: 

# Running tests:

..................

Finished tests in 0.898840s, 20.0258 tests/s, 70.0903 assertions/s.

18 tests, 63 assertions, 0 failures, 0 errors, 0 skips

===============================================================================================================================================================================================
Running test:rubyrhino
===============================================================================================================================================================================================

malloc_limit=80000000 (8000000)
heap_min_slots=1000000 (10000)
therubyrhino (Rhino) runtime is not available on this system

===============================================================================================================================================================================================
PASSED:  test:rubyracer
SKIPPED: test:javascriptcore, test:jscript, test:rubyrhino
FAILED:  test:node
===============================================================================================================================================================================================

rake aborted!
test failures
/home/ixti/Projects/execjs/Rakefile:58:in `block in <top (required)>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
```