1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Fix typo in variable name

Really convert input to UTF8-
This commit is contained in:
Ville Lautanala 2011-06-05 21:03:23 +03:00
parent 35064ed5e4
commit ae253dfb91
4 changed files with 8 additions and 8 deletions

View file

@ -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))

View file

@ -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})")

View file

@ -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})")

View file

@ -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})")