diff --git a/lib/execjs/external_runtime.rb b/lib/execjs/external_runtime.rb index 258bd34..850fa4f 100644 --- a/lib/execjs/external_runtime.rb +++ b/lib/execjs/external_runtime.rb @@ -9,7 +9,7 @@ module ExecJS end def eval(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source exec("return eval(#{MultiJson.encode("(#{source})")})") @@ -17,7 +17,7 @@ module ExecJS end def exec(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) compile_to_tempfile([@source, source].join("\n")) do |file| extract_result(@runtime.send(:exec_runtime, file.path)) diff --git a/lib/execjs/mustang_runtime.rb b/lib/execjs/mustang_runtime.rb index f02a244..f6b8f86 100644 --- a/lib/execjs/mustang_runtime.rb +++ b/lib/execjs/mustang_runtime.rb @@ -7,7 +7,7 @@ module ExecJS end def exec(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source eval "(function(){#{source}})()", options @@ -15,7 +15,7 @@ module ExecJS end def eval(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source unbox @v8_context.eval("(#{source})") diff --git a/lib/execjs/ruby_racer_runtime.rb b/lib/execjs/ruby_racer_runtime.rb index d026db7..db5582e 100644 --- a/lib/execjs/ruby_racer_runtime.rb +++ b/lib/execjs/ruby_racer_runtime.rb @@ -7,7 +7,7 @@ module ExecJS end def exec(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source eval "(function(){#{source}})()", options @@ -15,7 +15,7 @@ module ExecJS end def eval(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source unbox @v8_context.eval("(#{source})") diff --git a/lib/execjs/ruby_rhino_runtime.rb b/lib/execjs/ruby_rhino_runtime.rb index 2b90998..0c5aa24 100644 --- a/lib/execjs/ruby_rhino_runtime.rb +++ b/lib/execjs/ruby_rhino_runtime.rb @@ -7,7 +7,7 @@ module ExecJS end def exec(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source eval "(function(){#{source}})()", options @@ -15,7 +15,7 @@ module ExecJS end def eval(source, options = {}) - souce = source.encode('UTF-8') if source.respond_to?(:encode) + source = source.encode('UTF-8') if source.respond_to?(:encode) if /\S/ =~ source unbox @rhino_context.eval("(#{source})")