Fixes problems associated with node 10 and NAN (#14847)

* Fixes problems associated with node 10 and NAN

* Follow up removal of unnecessary linking to map object

* Remove header left over from debugging
This commit is contained in:
Blake Thompson
2019-06-26 13:38:06 -05:00
committed by GitHub
parent 012ccecaa4
commit a16c67d953
4 changed files with 60 additions and 53 deletions

View File

@@ -11,18 +11,19 @@
namespace node_mbgl {
class NodeMap;
class NodeRequest;
struct NodeAsyncRequest : public mbgl::AsyncRequest {
NodeAsyncRequest();
~NodeAsyncRequest() override;
NodeRequest* request;
};
class NodeRequest : public Nan::ObjectWrap {
class NodeRequest : public Nan::ObjectWrap,
public Nan::AsyncWorker {
public:
struct NodeAsyncRequest : public mbgl::AsyncRequest {
NodeAsyncRequest(NodeRequest*);
~NodeAsyncRequest() override;
NodeRequest* request;
};
NodeRequest(NodeMap*, mbgl::FileSource::Callback);
NodeRequest(mbgl::FileSource::Callback, NodeAsyncRequest*);
~NodeRequest();
static Nan::Persistent<v8::Function> constructor;
@@ -32,12 +33,11 @@ public:
static void New(const Nan::FunctionCallbackInfo<v8::Value>&);
static void HandleCallback(const Nan::FunctionCallbackInfo<v8::Value>&);
void Execute();
void unref();
private:
NodeMap* target;
mbgl::FileSource::Callback callback;
NodeAsyncRequest* asyncRequest = nullptr;
NodeAsyncRequest* asyncRequest;
Nan::AsyncResource* asyncResource = new Nan::AsyncResource("mbgl:execute");
};
}