[core] clang-tidy fixes
This commit is contained in:
@@ -173,7 +173,7 @@ struct ToValue {
|
||||
} else {
|
||||
serializedSection.emplace("fontStack", mbgl::NullValue());
|
||||
}
|
||||
sections.push_back(serializedSection);
|
||||
sections.emplace_back(serializedSection);
|
||||
}
|
||||
serialized.emplace("sections", sections);
|
||||
|
||||
@@ -205,7 +205,7 @@ v8::Local<v8::Value> toJS(const Value& value) {
|
||||
}
|
||||
|
||||
void NodeExpression::Evaluate(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
NodeExpression* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
auto* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
const std::unique_ptr<Expression>& expression = nodeExpr->expression;
|
||||
|
||||
if (info.Length() < 2 || !info[0]->IsObject()) {
|
||||
@@ -246,7 +246,7 @@ void NodeExpression::Evaluate(const Nan::FunctionCallbackInfo<v8::Value>& info)
|
||||
}
|
||||
|
||||
void NodeExpression::GetType(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
NodeExpression* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
auto* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
const std::unique_ptr<Expression>& expression = nodeExpr->expression;
|
||||
|
||||
const type::Type type = expression->getType();
|
||||
@@ -255,19 +255,19 @@ void NodeExpression::GetType(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
}
|
||||
|
||||
void NodeExpression::IsFeatureConstant(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
NodeExpression* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
auto* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
const std::unique_ptr<Expression>& expression = nodeExpr->expression;
|
||||
info.GetReturnValue().Set(Nan::New(isFeatureConstant(*expression)));
|
||||
}
|
||||
|
||||
void NodeExpression::IsZoomConstant(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
NodeExpression* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
auto* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
const std::unique_ptr<Expression>& expression = nodeExpr->expression;
|
||||
info.GetReturnValue().Set(Nan::New(isZoomConstant(*expression)));
|
||||
}
|
||||
|
||||
void NodeExpression::Serialize(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
NodeExpression* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
auto* nodeExpr = ObjectWrap::Unwrap<NodeExpression>(info.Holder());
|
||||
const std::unique_ptr<Expression>& expression = nodeExpr->expression;
|
||||
|
||||
const mbgl::Value serialized = expression->serialize();
|
||||
|
||||
@@ -47,9 +47,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
v8::Local<v8::String> type(const char* type) {
|
||||
v8::Local<v8::String> type(const char* type_) {
|
||||
Nan::EscapableHandleScope scope;
|
||||
return scope.Escape(Nan::New(type).ToLocalChecked());
|
||||
return scope.Escape(Nan::New(type_).ToLocalChecked());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1254,10 +1254,10 @@ std::unique_ptr<mbgl::AsyncRequest> NodeFileSource::request(const mbgl::Resource
|
||||
Nan::Set(instance, Nan::New("url").ToLocalChecked(), Nan::New(resource.url).ToLocalChecked());
|
||||
Nan::Set(instance, Nan::New("kind").ToLocalChecked(), Nan::New<v8::Integer>(resource.kind));
|
||||
|
||||
auto request = Nan::ObjectWrap::Unwrap<node_mbgl::NodeRequest>(instance);
|
||||
request->Execute();
|
||||
auto req = Nan::ObjectWrap::Unwrap<node_mbgl::NodeRequest>(instance);
|
||||
req->Execute();
|
||||
|
||||
return std::make_unique<node_mbgl::NodeRequest::NodeAsyncRequest>(request);
|
||||
return std::make_unique<node_mbgl::NodeRequest::NodeAsyncRequest>(req);
|
||||
}
|
||||
|
||||
} // namespace node_mbgl
|
||||
|
||||
Reference in New Issue
Block a user