From 6df049122c582d09423fb0c0e89b46a0ea854cfd Mon Sep 17 00:00:00 2001 From: Daniel van Hoesel Date: Wed, 28 Jun 2017 20:36:51 +0200 Subject: [PATCH] Pass object including the home id as callback arg --- src/callbacks.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/callbacks.cc b/src/callbacks.cc index 07bd9571..83472672 100644 --- a/src/callbacks.cc +++ b/src/callbacks.cc @@ -150,7 +150,11 @@ void handleNotification(NotifInfo *notif) { Nan::HandleScope scope; Local emitinfo[16]; + Local emitobj = Nan::New(); Local cbinfo = Nan::New(); + + AddIntegerProp(emitobj, homeid, notif->homeid); + // NodeInfo *node; // @@ -239,8 +243,9 @@ void handleNotification(NotifInfo *notif) mutex::scoped_lock sl(znodes_mutex); znodes[notif->nodeid] = node; } + AddIntegerProp(emitobj, nodeid, notif->nodeid); emitinfo[0] = Nan::New("node added").ToLocalChecked(); - emitinfo[1] = Nan::New(notif->nodeid); + emitinfo[1] = emitobj; emit_cb->Call(2, emitinfo); break; }