1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
This commit is contained in:
Bill Robertson 2009-11-14 00:05:52 -05:00
parent 5f1ce0f692
commit 707916fe03
3 changed files with 6 additions and 3 deletions

View file

@ -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'

View file

@ -55,7 +55,6 @@ VALUE v8_context_inject(VALUE self, VALUE key, VALUE value) {
RubyValueSource<V8HandleDest, Persistent<Value> > 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<Value> key_handle(String::New(key_string.c_str()));
@ -64,6 +63,6 @@ VALUE v8_context_inject(VALUE self, VALUE key, VALUE value) {
Local<Object> global = context->handle->Global();
global->Set(key_handle, value_handle);
return Qnil;
return value;
}

View file

@ -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