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:
parent
bbef262f17
commit
8078fe1712
1 changed files with 3 additions and 0 deletions
|
@ -76,6 +76,9 @@ module V8
|
||||||
end
|
end
|
||||||
|
|
||||||
def eval(source, filename = '<eval>', line = 1)
|
def eval(source, filename = '<eval>', line = 1)
|
||||||
|
if IO === source || StringIO === source
|
||||||
|
source = source.read
|
||||||
|
end
|
||||||
enter do
|
enter do
|
||||||
V8::C::TryCatch() do |trycatch|
|
V8::C::TryCatch() do |trycatch|
|
||||||
source = V8::C::String::New(source.to_s)
|
source = V8::C::String::New(source.to_s)
|
||||||
|
|
Loading…
Add table
Reference in a new issue