diff --git a/examples/node-addon/cpp/example.cpp b/examples/node-addon/cpp/example.cpp index 9ac8456..195c602 100644 --- a/examples/node-addon/cpp/example.cpp +++ b/examples/node-addon/cpp/example.cpp @@ -15,7 +15,7 @@ using namespace std; if (example->_isDestroyed) return; -Nan::Persistent Example::_constructor; +Nan::Persistent Example::_ctorExample; void Example::init(Handle target) { @@ -23,7 +23,7 @@ void Example::init(Handle target) { Local proto = Nan::New(newCtor); // class Example extends EventEmitter - Local parent = Nan::New(EventEmitter::_prototype); + Local parent = Nan::New(EventEmitter::_protoEventEmitter); proto->Inherit(parent); proto->InstanceTemplate()->SetInternalFieldCount(1); @@ -35,7 +35,7 @@ void Example::init(Handle target) { // -------- static Local ctor = Nan::GetFunction(proto).ToLocalChecked(); - _constructor.Reset(ctor); + _ctorExample.Reset(ctor); Nan::Set(target, JS_STR("Example"), ctor); diff --git a/examples/node-addon/cpp/example.hpp b/examples/node-addon/cpp/example.hpp index 9816ab5..c9df481 100644 --- a/examples/node-addon/cpp/example.hpp +++ b/examples/node-addon/cpp/example.hpp @@ -28,7 +28,7 @@ private: private: - static Nan::Persistent _constructor; + static Nan::Persistent _ctorExample; bool _isDestroyed; diff --git a/include/event-emitter.hpp b/include/event-emitter.hpp index d3fa83c..175321a 100644 --- a/include/event-emitter.hpp +++ b/include/event-emitter.hpp @@ -20,11 +20,11 @@ template class StaticHolder { protected: - static Nan::Persistent _prototype; - static Nan::Persistent _constructor; + static Nan::Persistent _protoEventEmitter; + static Nan::Persistent _ctorEventEmitter; }; -template Nan::Persistent StaticHolder::_prototype; -template Nan::Persistent StaticHolder::_constructor; +template Nan::Persistent StaticHolder::_protoEventEmitter; +template Nan::Persistent StaticHolder::_ctorEventEmitter; class EventEmitter : public StaticHolder, public Nan::ObjectWrap { @@ -79,8 +79,8 @@ public: Nan::SetMethod(ctorObj, "listenerCount", jsStaticListenerCount); - _constructor.Reset(ctor); - _prototype.Reset(proto); + _ctorEventEmitter.Reset(ctor); + _protoEventEmitter.Reset(proto); Nan::Set(target, JS_STR("EventEmitter"), ctor); diff --git a/package.json b/package.json index f0a5b55..0741527 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "addon-tools-raub", "author": "Luis Blanco ", "description": "A set of extra tools for Node.js addons", - "version": "0.1.3", + "version": "0.1.4", "main": "index.js", "keywords": [ "node",