1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/lib/v8/conversion/array.rb
2012-06-11 01:58:12 -05:00

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