diff --git a/lib/v8/context.rb b/lib/v8/context.rb index f2a1729..a4388c9 100644 --- a/lib/v8/context.rb +++ b/lib/v8/context.rb @@ -76,6 +76,9 @@ module V8 end def eval(source, filename = '', line = 1) + if IO === source || StringIO === source + source = source.read + end enter do V8::C::TryCatch() do |trycatch| source = V8::C::String::New(source.to_s)