Tag: 总线错误

从node.js本地代码调用callback

我正在使用c ++编写node.js的附加组件。 这里有一些片段: class Client : public node::ObjectWrap, public someObjectObserver { public: void onAsyncMethodEnds() { Local<Value> argv[] = { Local<Value>::New(String::New("TheString")) }; this->callback->Call(Context::GetCurrent()->Global(), 1, argv); } …. private: static v8::Handle<v8::Value> BeInitiator(const v8::Arguments& args) { HandleScope scope; Client* client = ObjectWrap::Unwrap<Client>(args.This()); client->someObject->asyncMethod(client, NULL); return scope.Close(Boolean::New(true)); } static v8::Handle<v8::Value> SetCallback(const v8::Arguments& args) { HandleScope scope; Client* client = […]