mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
tweaks
This commit is contained in:
parent
5f1ce0f692
commit
707916fe03
3 changed files with 6 additions and 3 deletions
|
@ -6,5 +6,9 @@ rescue LoadError
|
||||||
require 'spec'
|
require 'spec'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# $: is the load path $LOAD_PATH
|
||||||
|
#
|
||||||
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
||||||
|
$:.unshift(File.dirname(__FILE__) + '/..')
|
||||||
require 'v8'
|
require 'v8'
|
||||||
|
|
|
@ -55,7 +55,6 @@ VALUE v8_context_inject(VALUE self, VALUE key, VALUE value) {
|
||||||
RubyValueSource<V8HandleDest, Persistent<Value> > toHandle;
|
RubyValueSource<V8HandleDest, Persistent<Value> > toHandle;
|
||||||
|
|
||||||
const std::string key_string(tostring.push(key));
|
const std::string key_string(tostring.push(key));
|
||||||
const std::string value_string(tostring.push(value));
|
|
||||||
|
|
||||||
// does this need to be a persistent handle ?
|
// does this need to be a persistent handle ?
|
||||||
Persistent<Value> key_handle(String::New(key_string.c_str()));
|
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();
|
Local<Object> global = context->handle->Global();
|
||||||
global->Set(key_handle, value_handle);
|
global->Set(key_handle, value_handle);
|
||||||
|
|
||||||
return Qnil;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,6 @@ void v8_context_free(v8_context *context);
|
||||||
|
|
||||||
//methods
|
//methods
|
||||||
VALUE v8_context_eval(VALUE self, VALUE javascript);
|
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
|
#endif
|
Loading…
Add table
Reference in a new issue