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

Polymorphically thunk array values.

This commit is contained in:
Charles Lowell 2012-05-18 09:48:46 -05:00
parent 02586451aa
commit d3c9319357
2 changed files with 3 additions and 3 deletions

View file

@ -134,7 +134,7 @@ Object::operator VALUE() {
// return Function(handle);
}
if (handle->IsArray()) {
return Array(handle);
return Array((v8::Handle<v8::Array>)v8::Array::Cast(*handle));
}
if (handle->IsDate()) {
// return Date(handle);

View file

@ -10,11 +10,11 @@ describe V8::C::External do
end
it "can run a script and return a polymorphic result" do
V8::C::HandleScope() do
source = V8::C::String::New("(new Object())")
source = V8::C::String::New("(new Array())")
filename = V8::C::String::New("<eval>")
script = V8::C::Script::New(source, filename)
result = script.Run()
result.should be_kind_of V8::C::Object
result.should be_kind_of V8::C::Array
end
end
end