From 707916fe030ccdd0412f60480ac2805b67526633 Mon Sep 17 00:00:00 2001 From: Bill Robertson Date: Sat, 14 Nov 2009 00:05:52 -0500 Subject: [PATCH] tweaks --- spec/spec_helper.rb | 4 ++++ v8_context.cpp | 3 +-- v8_context.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 74361e0..2e2179e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,5 +6,9 @@ rescue LoadError require 'spec' end +# +# $: is the load path $LOAD_PATH +# $:.unshift(File.dirname(__FILE__) + '/../lib') +$:.unshift(File.dirname(__FILE__) + '/..') require 'v8' diff --git a/v8_context.cpp b/v8_context.cpp index 1cede82..6e48925 100644 --- a/v8_context.cpp +++ b/v8_context.cpp @@ -55,7 +55,6 @@ VALUE v8_context_inject(VALUE self, VALUE key, VALUE value) { RubyValueSource > toHandle; const std::string key_string(tostring.push(key)); - const std::string value_string(tostring.push(value)); // does this need to be a persistent handle ? Persistent key_handle(String::New(key_string.c_str())); @@ -64,6 +63,6 @@ VALUE v8_context_inject(VALUE self, VALUE key, VALUE value) { Local global = context->handle->Global(); global->Set(key_handle, value_handle); - return Qnil; + return value; } diff --git a/v8_context.h b/v8_context.h index b3a9128..03b65a8 100644 --- a/v8_context.h +++ b/v8_context.h @@ -41,6 +41,6 @@ void v8_context_free(v8_context *context); //methods VALUE v8_context_eval(VALUE self, VALUE javascript); -VALUE v8_context_inject(VALUE self, VALUE key, VALUE injectee); +VALUE v8_context_inject(VALUE self, VALUE key, VALUE value); #endif \ No newline at end of file