Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/v8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
require 'v8/conversion/symbol'
require 'v8/conversion/string'
require 'v8/conversion/fixnum'
require 'v8/conversion/bignum'
require 'v8/conversion'
require 'v8/access/names'
require 'v8/access/indices'
Expand Down
2 changes: 1 addition & 1 deletion lib/v8/conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def to_v8(ruby_object)
end
end

for type in [Class, Object, Array, Hash, String, Symbol, Time, Proc, Method, Fixnum] do
for type in [Class, Object, Array, Hash, String, Symbol, Time, Proc, Method, Fixnum, Bignum] do
type.class_eval do
include V8::Conversion.const_get(type.name)
end
Expand Down
11 changes: 11 additions & 0 deletions lib/v8/conversion/bignum.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class V8::Conversion
module Bignum
def to_ruby
self
end

def to_v8
self.to_f.to_v8
end
end
end