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

ensure that a value can be returned from a callback function.

This commit is contained in:
Charles Lowell 2012-05-25 16:06:41 -05:00
parent 687faa4865
commit 276653f830

View file

@ -24,11 +24,11 @@ describe V8::C::Template do
arguments.Holder().StrictEquals(receiver).should be_true
arguments.IsConstructCall().should be_false
arguments.Data().Value().should be(42)
nil
V8::C::String::New("result")
end
t = V8::C::FunctionTemplate::New(callback, V8::C::External::New(42))
f = t.GetFunction()
f.Call(receiver, 2, [V8::C::String::New('one'), V8::C::String::New('two')])
f.Call(receiver, 2, [V8::C::String::New('one'), V8::C::String::New('two')]).Utf8Value().should eql "result"
end
end
end