Persistent<Object> from Function Argument

81 views
Skip to first unread message

A. Mock

unread,
May 26, 2009, 6:12:43 PM5/26/09
to v8-users
I have a C++ function that gets called from JavaScript with two
arguments that I need Persistent handles to. I tried

v8::Local<v8::Object> obj = args[0]->ToObject();
v8::Local<v8::Function> updateFunc = v8::Local<v8::Function>::Cast(args
[1]->ToObject());
pUpdateFunc = v8::Persistent<v8::Function>::New(updateFunc);
pObj = v8::Persistent<v8::Object>::New(obj);

but as soon as I try to use those handles outside the function v8
exits with an assertion failure in debug mode and a segfault in
release mode. Is there any way to get a usable Persistent handle from
the function's arguments?

Feng

unread,
May 27, 2009, 8:00:34 PM5/27/09
to v8-users
Sounds like a bug.
Reply all
Reply to author
Forward
0 new messages