1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

Eval JavaScript from an IO object

This commit is contained in:
Charles Lowell 2012-06-12 07:11:45 -05:00
parent bbef262f17
commit 8078fe1712

View file

@ -76,6 +76,9 @@ module V8
end
def eval(source, filename = '<eval>', 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)