1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

unwrap wrapped v8 objects going back into runtime. unwrap ruby objects passing back to ruby.

This commit is contained in:
Charles Lowell 2010-05-17 18:53:14 +03:00
parent 85363d2f14
commit fcd7a0bd97
3 changed files with 4 additions and 2 deletions

View file

@ -115,9 +115,10 @@ Handle<Value> rr_rb2v8(VALUE value) {
return True();
case T_FALSE:
return False();
case T_DATA:
return V8_Ref_Get<Value>(value);
case T_OBJECT:
return rr_reflect_rb_object(value);
case T_DATA:
case T_CLASS:
case T_ICLASS:
case T_MODULE:

View file

@ -30,7 +30,7 @@ namespace {
cxt.Dispose();
}
} else {
thisObject = V8_Ref_Get<Object>(recv);
thisObject = rr_rb2v8(recv)->ToObject();
}
int f_argc = argc - 1;
Local<Value> arguments[f_argc];

View file

@ -18,6 +18,7 @@ module V8
when String then C::String.new(value)
when Proc then C::FunctionTemplate.new(&value).GetFunction()
when Method then C::FunctionTemplate.new(&value.to_proc).GetFunction()
when V8::Object then value.instance_variable_get(:@native)
else
value
end