src: fix linter failures

Fix linter failures when running the linter on all source files.

PR-URL: https://github.com/nodejs/node/pull/34582
Refs: https://github.com/nodejs/node/pull/34565
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Anna Henningsen 2020-07-31 17:58:53 +02:00 committed by James M Snell
parent 93959b22b1
commit bfebfdb149
14 changed files with 16 additions and 31 deletions

View File

@ -10,10 +10,10 @@ using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Local;
using v8::NewStringType;
using v8::Object;
using v8::String;
using v8::Value;
using v8::NewStringType;
void RunAtExit(Environment* env) {
env->RunAtExitCallbacks();

View File

@ -14,8 +14,8 @@ namespace node {
namespace inspector {
namespace {
using v8_inspector::StringView;
using v8_inspector::StringBuffer;
using v8_inspector::StringView;
template <typename T>
class DeletableWrapper : public Deletable {

View File

@ -43,13 +43,11 @@ using v8::HeapSpaceStatistics;
using v8::HeapStatistics;
using v8::Isolate;
using v8::Local;
using v8::Number;
using v8::Object;
using v8::StackTrace;
using v8::String;
using v8::TryCatch;
using v8::Value;
using v8::V8;
using v8::Value;
namespace per_process = node::per_process;

View File

@ -43,7 +43,6 @@ using crypto::SecureContext;
using v8::Array;
using v8::ArrayBufferView;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;

View File

@ -29,7 +29,6 @@ using crypto::EntropySource;
using crypto::SecureContext;
using v8::ArrayBufferView;
using v8::Boolean;
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;

View File

@ -27,10 +27,8 @@
namespace node {
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::Local;
using v8::Object;
using v8::Value;
namespace quic {

View File

@ -6,7 +6,6 @@ namespace {
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::NewStringType;
using v8::Object;
using v8::Promise;
using v8::String;

View File

@ -17,7 +17,6 @@ using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::NewStringType;
using v8::String;
using v8::Value;

View File

@ -5,12 +5,9 @@
namespace {
using v8::Context;
using v8::Function;
using v8::FunctionTemplate;
using v8::Isolate;
using v8::Local;
using v8::MaybeLocal;
using v8::NewStringType;
using v8::Object;
using v8::Script;
using v8::String;

View File

@ -25,8 +25,8 @@
using v8::Boolean;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::Local;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Value;

View File

@ -6,7 +6,6 @@ using v8::Context;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::Value;
// Give these things names in the public namespace so that we can see

View File

@ -5,8 +5,8 @@
#include "gtest/gtest.h"
using node::base64_encode;
using node::base64_decode;
using node::base64_encode;
TEST(Base64Test, Encode) {
auto test = [](const char* string, const char* base64_string) {

View File

@ -3,6 +3,16 @@
#include "env-inl.h"
#include "gtest/gtest.h"
using node::Calloc;
using node::Malloc;
using node::MaybeStackBuffer;
using node::SPrintF;
using node::StringEqualNoCase;
using node::StringEqualNoCaseN;
using node::ToLower;
using node::UncheckedCalloc;
using node::UncheckedMalloc;
TEST(UtilTest, ListHead) {
struct Item { node::ListNode<Item> node_; };
typedef node::ListHead<Item, &Item::node_> List;
@ -58,7 +68,6 @@ TEST(UtilTest, ListHead) {
}
TEST(UtilTest, StringEqualNoCase) {
using node::StringEqualNoCase;
EXPECT_FALSE(StringEqualNoCase("a", "b"));
EXPECT_TRUE(StringEqualNoCase("", ""));
EXPECT_TRUE(StringEqualNoCase("equal", "equal"));
@ -69,7 +78,6 @@ TEST(UtilTest, StringEqualNoCase) {
}
TEST(UtilTest, StringEqualNoCaseN) {
using node::StringEqualNoCaseN;
EXPECT_FALSE(StringEqualNoCaseN("a", "b", strlen("a")));
EXPECT_TRUE(StringEqualNoCaseN("", "", strlen("")));
EXPECT_TRUE(StringEqualNoCaseN("equal", "equal", strlen("equal")));
@ -84,7 +92,6 @@ TEST(UtilTest, StringEqualNoCaseN) {
}
TEST(UtilTest, ToLower) {
using node::ToLower;
EXPECT_EQ('0', ToLower('0'));
EXPECT_EQ('a', ToLower('a'));
EXPECT_EQ('a', ToLower('A'));
@ -98,7 +105,6 @@ TEST(UtilTest, ToLower) {
} while (0)
TEST(UtilTest, Malloc) {
using node::Malloc;
TEST_AND_FREE(Malloc<char>(0));
TEST_AND_FREE(Malloc<char>(1));
TEST_AND_FREE(Malloc(0));
@ -106,7 +112,6 @@ TEST(UtilTest, Malloc) {
}
TEST(UtilTest, Calloc) {
using node::Calloc;
TEST_AND_FREE(Calloc<char>(0));
TEST_AND_FREE(Calloc<char>(1));
TEST_AND_FREE(Calloc(0));
@ -114,7 +119,6 @@ TEST(UtilTest, Calloc) {
}
TEST(UtilTest, UncheckedMalloc) {
using node::UncheckedMalloc;
TEST_AND_FREE(UncheckedMalloc<char>(0));
TEST_AND_FREE(UncheckedMalloc<char>(1));
TEST_AND_FREE(UncheckedMalloc(0));
@ -122,7 +126,6 @@ TEST(UtilTest, UncheckedMalloc) {
}
TEST(UtilTest, UncheckedCalloc) {
using node::UncheckedCalloc;
TEST_AND_FREE(UncheckedCalloc<char>(0));
TEST_AND_FREE(UncheckedCalloc<char>(1));
TEST_AND_FREE(UncheckedCalloc(0));
@ -131,8 +134,6 @@ TEST(UtilTest, UncheckedCalloc) {
template <typename T>
static void MaybeStackBufferBasic() {
using node::MaybeStackBuffer;
MaybeStackBuffer<T> buf;
size_t old_length;
size_t old_capacity;
@ -211,8 +212,6 @@ static void MaybeStackBufferBasic() {
}
TEST(UtilTest, MaybeStackBuffer) {
using node::MaybeStackBuffer;
MaybeStackBufferBasic<uint8_t>();
MaybeStackBufferBasic<uint16_t>();
@ -254,8 +253,6 @@ TEST(UtilTest, MaybeStackBuffer) {
}
TEST(UtilTest, SPrintF) {
using node::SPrintF;
// %d, %u and %s all do the same thing. The actual C++ type is used to infer
// the right representation.
EXPECT_EQ(SPrintF("%s", false), "false");

View File

@ -16,8 +16,8 @@ using v8::Local;
using v8::Locker;
using v8::MaybeLocal;
using v8::SealHandleScope;
using v8::Value;
using v8::V8;
using v8::Value;
static int RunNodeInstance(MultiIsolatePlatform* platform,
const std::vector<std::string>& args,