1
0
Fork 0
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:
Charles Lowell 2010-05-27 19:28:50 +03:00
parent ab33a88411
commit 216ea6264e
3 changed files with 7 additions and 17 deletions

View file

@ -8,12 +8,6 @@ module V8
@scope = V8::Object.new(@native.Global(), @native) @scope = V8::Object.new(@native.Global(), @native)
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
@ -57,11 +51,7 @@ module V8
def []=(key, value) def []=(key, value)
@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

View file

@ -30,8 +30,10 @@ module V8
end end
def each def each
for prop in To.rb(@native.GetPropertyNames()) @context.enter do
yield prop, self[prop] for prop in To.rb(@native.GetPropertyNames())
yield prop, self[prop]
end
end end
end end
end end
@ -39,8 +41,6 @@ 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