mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
finalize change of To.ruby() -> To.rb()
This commit is contained in:
parent
ff0e11fee8
commit
2b1c38b792
5 changed files with 11 additions and 13 deletions
|
@ -5,7 +5,7 @@ module V8
|
|||
def each
|
||||
@context.enter do
|
||||
for i in 0..(@native.Length() - 1)
|
||||
yield To.ruby(@native.Get(i))
|
||||
yield To.rb(@native.Get(i))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,7 +28,7 @@ module V8
|
|||
if try.HasCaught()
|
||||
err = JavascriptError.new(try)
|
||||
else
|
||||
value = To.ruby(result)
|
||||
value = To.rb(result)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -69,11 +69,11 @@ module V8
|
|||
|
||||
def initialize(try)
|
||||
msg = try.Message()
|
||||
@source_name = To.ruby(msg.GetScriptResourceName())
|
||||
@source_line = To.ruby(msg.GetSourceLine())
|
||||
@line_number = To.ruby(msg.GetLineNumber())
|
||||
@javascript_stacktrace = To.ruby(try.StackTrace())
|
||||
super("#{To.ruby(msg.Get())}: #{@source_name}:#{@line_number}")
|
||||
@source_name = To.rb(msg.GetScriptResourceName())
|
||||
@source_line = To.rb(msg.GetSourceLine())
|
||||
@line_number = To.rb(msg.GetLineNumber())
|
||||
@javascript_stacktrace = To.rb(try.StackTrace())
|
||||
super("#{To.rb(msg.Get())}: #{@source_name}:#{@line_number}")
|
||||
end
|
||||
|
||||
def self.check(try)
|
||||
|
|
|
@ -7,7 +7,7 @@ module V8
|
|||
C::TryCatch.try do |try|
|
||||
@context.enter do
|
||||
this = To.v8(thisObject)
|
||||
return_value = To.ruby(@native.Call(this, To.v8(args)))
|
||||
return_value = To.rb(@native.Call(this, To.v8(args)))
|
||||
err = JavascriptError.new(try) if try.HasCaught()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ module V8
|
|||
|
||||
def [](key)
|
||||
@context.enter do
|
||||
To.ruby(@native.Get(To.v8(key)))
|
||||
To.rb(@native.Get(To.v8(key)))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
module V8
|
||||
module To
|
||||
class << self
|
||||
def ruby(value)
|
||||
def rb(value)
|
||||
case value
|
||||
when V8::C::Function then V8::Function.new(value)
|
||||
when V8::C::Array then V8::Array.new(value)
|
||||
|
@ -14,8 +14,6 @@ module V8
|
|||
end
|
||||
end
|
||||
|
||||
alias_method :rb, :ruby
|
||||
|
||||
def v8(value)
|
||||
case value
|
||||
when V8::Object
|
||||
|
@ -26,7 +24,7 @@ module V8
|
|||
template = C::FunctionTemplate::New() do |arguments|
|
||||
rbargs = []
|
||||
for i in 0..arguments.Length() - 1
|
||||
rbargs << To.ruby(arguments[i])
|
||||
rbargs << To.rb(arguments[i])
|
||||
end
|
||||
V8::Function.rubycall(value, *rbargs)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue