[node] remove internal NodeRequest class from public API

This commit is contained in:
Mike Morris
2016-10-12 17:29:44 -04:00
parent 817c26111a
commit a894870fb8
4 changed files with 4 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ public:
static Nan::Persistent<v8::Function> constructor;
static void Init(v8::Local<v8::Object> exports);
static void Init(v8::Local<v8::Object>);
static void New(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Load(const Nan::FunctionCallbackInfo<v8::Value>&);

View File

@@ -19,7 +19,7 @@ void RegisterModule(v8::Local<v8::Object> target, v8::Local<v8::Object> module)
nodeRunLoop.stop();
node_mbgl::NodeMap::Init(target);
node_mbgl::NodeRequest::Init(target);
node_mbgl::NodeRequest::Init();
// Exports Resource constants.
v8::Local<v8::Object> resource = Nan::New<v8::Object>();

View File

@@ -26,7 +26,7 @@ NodeRequest::~NodeRequest() {
Nan::Persistent<v8::Function> NodeRequest::constructor;
NAN_MODULE_INIT(NodeRequest::Init) {
void NodeRequest::Init() {
v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
tpl->InstanceTemplate()->SetInternalFieldCount(1);
@@ -35,9 +35,6 @@ NAN_MODULE_INIT(NodeRequest::Init) {
Nan::SetPrototypeMethod(tpl, "respond", HandleCallback);
constructor.Reset(tpl->GetFunction());
// TODO: Remove this from the public JavaScript API
Nan::Set(target, Nan::New("Request").ToLocalChecked(), tpl->GetFunction());
}
void NodeRequest::New(const Nan::FunctionCallbackInfo<v8::Value>& info) {

View File

@@ -27,7 +27,7 @@ public:
static Nan::Persistent<v8::Function> constructor;
static NAN_MODULE_INIT(Init);
static void Init();
static void New(const Nan::FunctionCallbackInfo<v8::Value>&);
static void HandleCallback(const Nan::FunctionCallbackInfo<v8::Value>&);