2015-12-11 5 views
-1

J'essaye seulement de construire un addon qui ne reçoit qu'un objet et le renvoie.Stockez l'objet JS et renvoyez-le - Nodejs addon

Serveur:

var is_object = addon.return_object(previous_object); 

Addon:

void return_object(const FunctionCallbackInfo<v8::Value>& args) { 
    Isolate* isolate = Isolate::GetCurrent(); 
    HandleScope scope(isolate); 

    Local<Object> obj = Object::"From args"; //The missing part 

    args->GetReturnValue().Set(obj); 
} 

Répondre

0

La méthode est:

Local<Object> obj = args[arg_value]->ToObject();