mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
17 lines
No EOL
275 B
Ruby
17 lines
No EOL
275 B
Ruby
class V8::Conversion
|
|
module Array
|
|
def to_v8
|
|
array = V8::Array.new(length)
|
|
each_with_index do |item, i|
|
|
array[i] = item
|
|
end
|
|
return array.to_v8
|
|
end
|
|
end
|
|
|
|
module NativeArray
|
|
def to_ruby
|
|
V8::Array.new(self)
|
|
end
|
|
end
|
|
end |