mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
remove the deprecated open() method on context.
This commit is contained in:
parent
ab33a88411
commit
216ea6264e
3 changed files with 7 additions and 17 deletions
|
@ -9,12 +9,6 @@ module V8
|
||||||
yield(self) if block_given?
|
yield(self) if block_given?
|
||||||
end
|
end
|
||||||
|
|
||||||
def open
|
|
||||||
@native.enter do
|
|
||||||
yield(self)
|
|
||||||
end if block_given?
|
|
||||||
end
|
|
||||||
|
|
||||||
def eval(javascript, filename = "<eval>", line = 1)
|
def eval(javascript, filename = "<eval>", line = 1)
|
||||||
if IO === javascript || StringIO === javascript
|
if IO === javascript || StringIO === javascript
|
||||||
javascript = javascript.read()
|
javascript = javascript.read()
|
||||||
|
@ -58,10 +52,6 @@ module V8
|
||||||
@scope[key] = value
|
@scope[key] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.open(opts = {}, &block)
|
|
||||||
new(opts).open(&block)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.eval(source)
|
def self.eval(source)
|
||||||
new.eval(source)
|
new.eval(source)
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,17 +30,17 @@ module V8
|
||||||
end
|
end
|
||||||
|
|
||||||
def each
|
def each
|
||||||
|
@context.enter do
|
||||||
for prop in To.rb(@native.GetPropertyNames())
|
for prop in To.rb(@native.GetPropertyNames())
|
||||||
yield prop, self[prop]
|
yield prop, self[prop]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Object
|
class Object
|
||||||
def eval_js(javascript)
|
def eval_js(javascript)
|
||||||
V8::Context.open(:with => self) do |cxt|
|
V8::Context.new(:with => self).eval(javascript)
|
||||||
cxt.eval(javascript)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8ecf5e635559a8e5043b426c764dd3a8492d209f
|
Subproject commit f1d47fe8303d6ae6a85d6e523368f79a20c4354e
|
Loading…
Reference in a new issue