Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
Fix typo in variable name
Browse files Browse the repository at this point in the history
Really convert input to UTF8-
  • Loading branch information
lautis committed Jun 5, 2011
1 parent 35064ed commit ae253df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/execjs/external_runtime.rb
Expand Up @@ -9,15 +9,15 @@ def initialize(runtime, source = "")
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})")})")
end
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))
Expand Down
4 changes: 2 additions & 2 deletions lib/execjs/mustang_runtime.rb
Expand Up @@ -7,15 +7,15 @@ def initialize(source = "")
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
end
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})")
Expand Down
4 changes: 2 additions & 2 deletions lib/execjs/ruby_racer_runtime.rb
Expand Up @@ -7,15 +7,15 @@ def initialize(source = "")
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
end
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})")
Expand Down
4 changes: 2 additions & 2 deletions lib/execjs/ruby_rhino_runtime.rb
Expand Up @@ -7,15 +7,15 @@ def initialize(source = "")
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
end
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})")
Expand Down

0 comments on commit ae253df

Please sign in to comment.