我正在使用节点12和NAN开发一个更小的节点插件。当我尝试保存一个JS回调以便稍后执行时,我遇到了一个问题。}
static void updateCallback() // HERE is the place where I want to call the JS) if (info.IsConstructCall())
// This is the JS callback,
假设我有一个JS函数,它只是抛出一个错误:这个函数作为参数传入一个node.js加载项,并用于构造一个Nan::回调(它应该负责使这个句柄持久):
`// get handle to JS function and its Tcl nameHandle<Function> fun = Handle<Function>::Cast( info[0] ); <