execjs 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,7 +59,7 @@ module ExecJS
59
59
  status, value = output.empty? ? [] : MultiJson.decode(output)
60
60
  if status == "ok"
61
61
  value
62
- elsif value == "SyntaxError: Parse error"
62
+ elsif value =~ /SyntaxError:/
63
63
  raise RuntimeError, value
64
64
  else
65
65
  raise ProgramError, value
@@ -44,6 +44,12 @@ module ExecJS
44
44
  raise RuntimeError, value.message
45
45
  when Mustang::V8::Error
46
46
  raise ProgramError, value.message
47
+ when Mustang::V8::Object
48
+ value.inject({}) { |h, (k, v)|
49
+ v = unbox(v)
50
+ h[k] = v if v
51
+ h
52
+ }
47
53
  else
48
54
  value.respond_to?(:delegate) ? value.delegate : value
49
55
  end
@@ -30,7 +30,7 @@ module ExecJS
30
30
  SpiderMonkey = Spidermonkey = ExternalRuntime.new(
31
31
  :name => "SpiderMonkey",
32
32
  :command => "js",
33
- :runner_path => ExecJS.root + "/support/basic_runner.js"
33
+ :runner_path => ExecJS.root + "/support/spidermonkey_runner.js"
34
34
  )
35
35
 
36
36
  JScript = ExternalRuntime.new(
@@ -1,4 +1,5 @@
1
- (function(program, execJS) { execJS(program) })(function() { #{source}
1
+ (function(program, execJS) { execJS(program) })(function() {
2
+ return eval(#{encoded_source});
2
3
  }, function(program) {
3
4
  #{json2_source}
4
5
  var output, print = function(string) {
@@ -1,3 +1,3 @@
1
1
  module ExecJS
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execjs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 5
10
- version: 1.2.5
9
+ - 6
10
+ version: 1.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Stephenson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-12 00:00:00 -05:00
19
+ date: 2011-09-13 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -124,11 +124,11 @@ files:
124
124
  - lib/execjs/ruby_racer_runtime.rb
125
125
  - lib/execjs/ruby_rhino_runtime.rb
126
126
  - lib/execjs/runtimes.rb
127
- - lib/execjs/support/basic_runner.js
128
127
  - lib/execjs/support/jsc_runner.js
129
128
  - lib/execjs/support/jscript_runner.js
130
129
  - lib/execjs/support/json2.js
131
130
  - lib/execjs/support/node_runner.js
131
+ - lib/execjs/support/spidermonkey_runner.js
132
132
  - lib/execjs/support/which.bat
133
133
  - lib/execjs/version.rb
134
134
  - lib/execjs.rb