cpplint: disallow comma-first in C++
This commit is contained in:
parent
a2d1cbef6b
commit
7063c59b97
@ -52,14 +52,14 @@ inline void Environment::IsolateData::Put() {
|
||||
}
|
||||
|
||||
inline Environment::IsolateData::IsolateData(v8::Isolate* isolate)
|
||||
: event_loop_(uv_default_loop())
|
||||
, isolate_(isolate)
|
||||
: event_loop_(uv_default_loop()),
|
||||
isolate_(isolate),
|
||||
#define V(PropertyName, StringValue) \
|
||||
, PropertyName ## _index_( \
|
||||
FIXED_ONE_BYTE_STRING(isolate, StringValue).Eternalize(isolate))
|
||||
PropertyName ## _index_( \
|
||||
FIXED_ONE_BYTE_STRING(isolate, StringValue).Eternalize(isolate)),
|
||||
PER_ISOLATE_STRING_PROPERTIES(V)
|
||||
#undef V
|
||||
, ref_count_(0) {
|
||||
ref_count_(0) {
|
||||
}
|
||||
|
||||
inline uv_loop_t* Environment::IsolateData::event_loop() const {
|
||||
@ -155,11 +155,11 @@ inline Environment* Environment::GetCurrentChecked(
|
||||
}
|
||||
|
||||
inline Environment::Environment(v8::Local<v8::Context> context)
|
||||
: isolate_(context->GetIsolate())
|
||||
, isolate_data_(IsolateData::GetOrCreate(context->GetIsolate()))
|
||||
, using_smalloc_alloc_cb_(false)
|
||||
, using_domains_(false)
|
||||
, context_(context->GetIsolate(), context) {
|
||||
: isolate_(context->GetIsolate()),
|
||||
isolate_data_(IsolateData::GetOrCreate(context->GetIsolate())),
|
||||
using_smalloc_alloc_cb_(false),
|
||||
using_domains_(false),
|
||||
context_(context->GetIsolate(), context) {
|
||||
// We'll be creating new objects so make sure we've entered the context.
|
||||
v8::Context::Scope context_scope(context);
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
|
@ -89,9 +89,9 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
|
||||
HandleWrap::HandleWrap(Environment* env,
|
||||
Handle<Object> object,
|
||||
uv_handle_t* handle)
|
||||
: env_(env)
|
||||
, flags_(0)
|
||||
, handle__(handle) {
|
||||
: env_(env),
|
||||
flags_(0),
|
||||
handle__(handle) {
|
||||
handle__->data = this;
|
||||
HandleScope scope(node_isolate);
|
||||
persistent().Reset(node_isolate, object);
|
||||
|
@ -64,12 +64,12 @@ class ContextifyContext {
|
||||
|
||||
public:
|
||||
explicit ContextifyContext(Environment* env, Local<Object> sandbox)
|
||||
: env_(env)
|
||||
, sandbox_(env->isolate(), sandbox)
|
||||
, context_(env->isolate(), CreateV8Context(env))
|
||||
, proxy_global_(env->isolate(), context()->Global())
|
||||
: env_(env),
|
||||
sandbox_(env->isolate(), sandbox),
|
||||
context_(env->isolate(), CreateV8Context(env)),
|
||||
proxy_global_(env->isolate(), context()->Global()),
|
||||
// Wait for sandbox_, proxy_global_, and context_ to die
|
||||
, references_(3) {
|
||||
references_(3) {
|
||||
sandbox_.MakeWeak(this, WeakCallback);
|
||||
sandbox_.MarkIndependent();
|
||||
context_.MakeWeak(this, WeakCallback);
|
||||
|
@ -94,10 +94,10 @@ class SecureContext : public WeakObject {
|
||||
static void SetTicketKeys(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
SecureContext(Environment* env, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(env->isolate(), wrap)
|
||||
, ca_store_(NULL)
|
||||
, ctx_(NULL)
|
||||
, env_(env) {
|
||||
: WeakObject(env->isolate(), wrap),
|
||||
ca_store_(NULL),
|
||||
ctx_(NULL),
|
||||
env_(env) {
|
||||
}
|
||||
|
||||
void FreeCTXMem() {
|
||||
@ -134,10 +134,10 @@ class SSLWrap {
|
||||
};
|
||||
|
||||
SSLWrap(Environment* env, SecureContext* sc, Kind kind)
|
||||
: env_(env)
|
||||
, kind_(kind)
|
||||
, next_sess_(NULL)
|
||||
, session_callbacks_(false) {
|
||||
: env_(env),
|
||||
kind_(kind),
|
||||
next_sess_(NULL),
|
||||
session_callbacks_(false) {
|
||||
ssl_ = SSL_new(sc->ctx_);
|
||||
assert(ssl_ != NULL);
|
||||
}
|
||||
@ -285,11 +285,11 @@ class Connection : public SSLWrap<Connection>, public WeakObject {
|
||||
v8::Local<v8::Object> wrap,
|
||||
SecureContext* sc,
|
||||
SSLWrap<Connection>::Kind kind)
|
||||
: SSLWrap<Connection>(env, sc, kind)
|
||||
, WeakObject(env->isolate(), wrap)
|
||||
, bio_read_(NULL)
|
||||
, bio_write_(NULL)
|
||||
, hello_offset_(0) {
|
||||
: SSLWrap<Connection>(env, sc, kind),
|
||||
WeakObject(env->isolate(), wrap),
|
||||
bio_read_(NULL),
|
||||
bio_write_(NULL),
|
||||
hello_offset_(0) {
|
||||
hello_parser_.Start(SSLWrap<Connection>::OnClientHello,
|
||||
OnClientHelloParseEnd,
|
||||
this);
|
||||
@ -347,10 +347,10 @@ class CipherBase : public WeakObject {
|
||||
CipherBase(v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> wrap,
|
||||
CipherKind kind)
|
||||
: WeakObject(isolate, wrap)
|
||||
, cipher_(NULL)
|
||||
, initialised_(false)
|
||||
, kind_(kind) {
|
||||
: WeakObject(isolate, wrap),
|
||||
cipher_(NULL),
|
||||
initialised_(false),
|
||||
kind_(kind) {
|
||||
}
|
||||
|
||||
~CipherBase() {
|
||||
@ -380,9 +380,9 @@ class Hmac : public WeakObject {
|
||||
static void HmacDigest(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
Hmac(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(isolate, wrap)
|
||||
, md_(NULL)
|
||||
, initialised_(false) {
|
||||
: WeakObject(isolate, wrap),
|
||||
md_(NULL),
|
||||
initialised_(false) {
|
||||
}
|
||||
|
||||
~Hmac() {
|
||||
@ -409,9 +409,9 @@ class Hash : public WeakObject {
|
||||
static void HashDigest(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
Hash(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(isolate, wrap)
|
||||
, md_(NULL)
|
||||
, initialised_(false) {
|
||||
: WeakObject(isolate, wrap),
|
||||
md_(NULL),
|
||||
initialised_(false) {
|
||||
}
|
||||
|
||||
~Hash() {
|
||||
@ -443,9 +443,9 @@ class Sign : public WeakObject {
|
||||
static void SignFinal(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
Sign(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(isolate, wrap)
|
||||
, md_(NULL)
|
||||
, initialised_(false) {
|
||||
: WeakObject(isolate, wrap),
|
||||
md_(NULL),
|
||||
initialised_(false) {
|
||||
}
|
||||
|
||||
~Sign() {
|
||||
@ -477,9 +477,9 @@ class Verify : public WeakObject {
|
||||
static void VerifyFinal(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
Verify(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(isolate, wrap)
|
||||
, md_(NULL)
|
||||
, initialised_(false) {
|
||||
: WeakObject(isolate, wrap),
|
||||
md_(NULL),
|
||||
initialised_(false) {
|
||||
}
|
||||
|
||||
~Verify() {
|
||||
@ -515,9 +515,9 @@ class DiffieHellman : public WeakObject {
|
||||
static void SetPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
|
||||
DiffieHellman(v8::Isolate* isolate, v8::Local<v8::Object> wrap)
|
||||
: WeakObject(isolate, wrap)
|
||||
, initialised_(false)
|
||||
, dh(NULL) {
|
||||
: WeakObject(isolate, wrap),
|
||||
initialised_(false),
|
||||
dh(NULL) {
|
||||
}
|
||||
|
||||
~DiffieHellman() {
|
||||
|
@ -67,9 +67,9 @@ using v8::Value;
|
||||
class FSReqWrap: public ReqWrap<uv_fs_t> {
|
||||
public:
|
||||
FSReqWrap(Environment* env, const char* syscall, char* data = NULL)
|
||||
: ReqWrap<uv_fs_t>(env)
|
||||
, syscall_(syscall)
|
||||
, data_(data) {
|
||||
: ReqWrap<uv_fs_t>(env),
|
||||
syscall_(syscall),
|
||||
data_(data) {
|
||||
}
|
||||
|
||||
void ReleaseEarly() {
|
||||
|
@ -190,10 +190,10 @@ struct StringPtr {
|
||||
class Parser : public WeakObject {
|
||||
public:
|
||||
Parser(Environment* env, Local<Object> wrap, enum http_parser_type type)
|
||||
: WeakObject(env->isolate(), wrap)
|
||||
, env_(env)
|
||||
, current_buffer_len_(0)
|
||||
, current_buffer_data_(NULL) {
|
||||
: WeakObject(env->isolate(), wrap),
|
||||
env_(env),
|
||||
current_buffer_len_(0),
|
||||
current_buffer_data_(NULL) {
|
||||
Init(type);
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,9 @@ static void Delete(uv_handle_t* handle) {
|
||||
|
||||
|
||||
StatWatcher::StatWatcher(Environment* env, Local<Object> wrap)
|
||||
: WeakObject(env->isolate(), wrap)
|
||||
, watcher_(new uv_fs_poll_t)
|
||||
, env_(env) {
|
||||
: WeakObject(env->isolate(), wrap),
|
||||
watcher_(new uv_fs_poll_t),
|
||||
env_(env) {
|
||||
uv_fs_poll_init(env->event_loop(), watcher_);
|
||||
watcher_->data = static_cast<void*>(this);
|
||||
}
|
||||
|
@ -71,21 +71,21 @@ class ZCtx : public WeakObject {
|
||||
public:
|
||||
|
||||
ZCtx(Environment* env, Local<Object> wrap, node_zlib_mode mode)
|
||||
: WeakObject(env->isolate(), wrap)
|
||||
, chunk_size_(0)
|
||||
, dictionary_(NULL)
|
||||
, dictionary_len_(0)
|
||||
, env_(env)
|
||||
, err_(0)
|
||||
, flush_(0)
|
||||
, init_done_(false)
|
||||
, level_(0)
|
||||
, memLevel_(0)
|
||||
, mode_(mode)
|
||||
, strategy_(0)
|
||||
, windowBits_(0)
|
||||
, write_in_progress_(false)
|
||||
, refs_(0) {
|
||||
: WeakObject(env->isolate(), wrap),
|
||||
chunk_size_(0),
|
||||
dictionary_(NULL),
|
||||
dictionary_len_(0),
|
||||
env_(env),
|
||||
err_(0),
|
||||
flush_(0),
|
||||
init_done_(false),
|
||||
level_(0),
|
||||
memLevel_(0),
|
||||
mode_(mode),
|
||||
strategy_(0),
|
||||
windowBits_(0),
|
||||
write_in_progress_(false),
|
||||
refs_(0) {
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,10 +54,10 @@ using v8::Value;
|
||||
StreamWrap::StreamWrap(Environment* env,
|
||||
Local<Object> object,
|
||||
uv_stream_t* stream)
|
||||
: HandleWrap(env, object, reinterpret_cast<uv_handle_t*>(stream))
|
||||
, stream_(stream)
|
||||
, default_callbacks_(this)
|
||||
, callbacks_(&default_callbacks_) {
|
||||
: HandleWrap(env, object, reinterpret_cast<uv_handle_t*>(stream)),
|
||||
stream_(stream),
|
||||
default_callbacks_(this),
|
||||
callbacks_(&default_callbacks_) {
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,8 +38,8 @@ typedef class ReqWrap<uv_shutdown_t> ShutdownWrap;
|
||||
class WriteWrap: public ReqWrap<uv_write_t> {
|
||||
public:
|
||||
WriteWrap(Environment* env, v8::Local<v8::Object> obj, StreamWrap* wrap)
|
||||
: ReqWrap<uv_write_t>(env, obj)
|
||||
, wrap_(wrap) {
|
||||
: ReqWrap<uv_write_t>(env, obj),
|
||||
wrap_(wrap) {
|
||||
}
|
||||
|
||||
void* operator new(size_t size, char* storage) { return storage; }
|
||||
|
@ -60,8 +60,8 @@ class SendWrap : public ReqWrap<uv_udp_send_t> {
|
||||
SendWrap::SendWrap(Environment* env,
|
||||
Local<Object> req_wrap_obj,
|
||||
bool have_callback)
|
||||
: ReqWrap<uv_udp_send_t>(env, req_wrap_obj)
|
||||
, have_callback_(have_callback) {
|
||||
: ReqWrap<uv_udp_send_t>(env, req_wrap_obj),
|
||||
have_callback_(have_callback) {
|
||||
}
|
||||
|
||||
|
||||
|
3
tools/cpplint.py
vendored
3
tools/cpplint.py
vendored
@ -2108,6 +2108,9 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, error):
|
||||
'the base class list in a class definition, the colon should '
|
||||
'be on the following line.')
|
||||
|
||||
if len(line) > initial_spaces and line[initial_spaces] == ',':
|
||||
error(filename, linenum, 'whitespace/commafirst', 4,
|
||||
'Comma-first style is not allowed')
|
||||
|
||||
# Check if the line is a header guard.
|
||||
is_header_guard = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user