From 5b9959736dcbf7952f2ad8478dd1c0ab22eab688 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 12 Jul 2016 23:58:19 -0400 Subject: [node] modern NAN style updates --- platform/node/src/node_request.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'platform/node/src/node_request.cpp') diff --git a/platform/node/src/node_request.cpp b/platform/node/src/node_request.cpp index b4016eabad..b9a6779a8f 100644 --- a/platform/node/src/node_request.cpp +++ b/platform/node/src/node_request.cpp @@ -69,10 +69,10 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf if (info.Length() < 1) { response.noContent = true; } else if (info[0]->IsObject()) { - auto err = info[0]->ToObject(); + auto err = Nan::To(info[0]).ToLocalChecked(); auto msg = Nan::New("message").ToLocalChecked(); - if (Nan::Has(err, msg).IsJust()) { + if (Nan::Has(err, msg).FromJust()) { request->SetErrorMessage(*Nan::Utf8String( Nan::Get(err, msg).ToLocalChecked())); } @@ -83,7 +83,7 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf } else { auto res = Nan::To(info[1]).ToLocalChecked(); - if (Nan::Has(res, Nan::New("modified").ToLocalChecked()).IsJust()) { + if (Nan::Has(res, Nan::New("modified").ToLocalChecked()).FromJust()) { const double modified = Nan::To(Nan::Get(res, Nan::New("modified").ToLocalChecked()).ToLocalChecked()).FromJust(); if (!std::isnan(modified)) { response.modified = mbgl::Timestamp{ mbgl::Seconds( @@ -91,7 +91,7 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf } } - if (Nan::Has(res, Nan::New("expires").ToLocalChecked()).IsJust()) { + if (Nan::Has(res, Nan::New("expires").ToLocalChecked()).FromJust()) { const double expires = Nan::To(Nan::Get(res, Nan::New("expires").ToLocalChecked()).ToLocalChecked()).FromJust(); if (!std::isnan(expires)) { response.expires = mbgl::Timestamp{ mbgl::Seconds( @@ -99,12 +99,12 @@ void NodeRequest::HandleCallback(const Nan::FunctionCallbackInfo& inf } } - if (Nan::Has(res, Nan::New("etag").ToLocalChecked()).IsJust()) { + if (Nan::Has(res, Nan::New("etag").ToLocalChecked()).FromJust()) { const Nan::Utf8String etag(Nan::Get(res, Nan::New("etag").ToLocalChecked()).ToLocalChecked()); response.etag = std::string { *etag, size_t(etag.length()) }; } - if (Nan::Has(res, Nan::New("data").ToLocalChecked()).IsJust()) { + if (Nan::Has(res, Nan::New("data").ToLocalChecked()).FromJust()) { auto data = Nan::Get(res, Nan::New("data").ToLocalChecked()).ToLocalChecked(); if (node::Buffer::HasInstance(data)) { response.data = std::make_shared( -- cgit v1.2.1