From bec7b7a13d12aa9a4d51b6e67c37b01b9b967a2d Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 5 Aug 2010 11:35:30 -0500 Subject: [PATCH] bind global scope object to potential ruby implementation *after* creating the context, that way, context.scope is *always* a V8::Object --- lib/v8/context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v8/context.rb b/lib/v8/context.rb index 9579576..e47c756 100644 --- a/lib/v8/context.rb +++ b/lib/v8/context.rb @@ -6,8 +6,8 @@ module V8 def initialize(opts = {}) @native = opts[:with] ? C::Context::New(Access.rubyobject) : C::Context::New() @native.enter do - @native.Global().SetHiddenValue(C::String::New("TheRubyRacer::RubyObject"), C::External::New(opts[:with])) if opts[:with] @scope = To.rb(@native.Global()) + @native.Global().SetHiddenValue(C::String::New("TheRubyRacer::RubyObject"), C::External::New(opts[:with])) if opts[:with] end yield(self) if block_given? end