Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linted code #581

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nan_maybe_pre_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ class MaybeLocal {

template<typename S>
# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
inline MaybeLocal(v8::Local<S> that) : val_(that) {}
inline MaybeLocal(v8::Local<S> that) : // NOLINT(runtime/explicit)
val_(that) {}
# else
inline MaybeLocal(v8::Local<S> that) :
inline MaybeLocal(v8::Local<S> that) : // NOLINT(runtime/explicit)
val_(*reinterpret_cast<v8::Local<T>*>(&that)) {}

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

# endif

Expand Down
15 changes: 9 additions & 6 deletions nan_persistent_12_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ template<typename T, typename M> class Persistent :
public:
inline Persistent() : v8::Persistent<T, M>() {}

template<typename S> inline Persistent(v8::Local<S> that) :
template<typename S> explicit inline Persistent(v8::Local<S> that) :
v8::Persistent<T, M>(v8::Isolate::GetCurrent(), that) {}

template<typename S, typename M2>
inline Persistent(const v8::Persistent<S, M2> &that) :
inline
Persistent(const v8::Persistent<S, M2> &that) : // NOLINT(runtime/explicit)
v8::Persistent<T, M2>(v8::Isolate::GetCurrent(), that) {}

This comment was marked as off-topic.


inline void Reset() { v8::PersistentBase<T>::Reset(); }
Expand Down Expand Up @@ -62,11 +63,12 @@ class Global : public v8::Global<T> {
public:
inline Global() : v8::Global<T>() {}

template<typename S> inline Global(v8::Local<S> that) :
template<typename S> inline explicit Global(v8::Local<S> that) :
v8::Global<T>(v8::Isolate::GetCurrent(), that) {}

template<typename S>
inline Global(const v8::PersistentBase<S> &that) :
inline
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)

This comment was marked as off-topic.

v8::Global<S>(v8::Isolate::GetCurrent(), that) {}

inline void Reset() { v8::PersistentBase<T>::Reset(); }
Expand Down Expand Up @@ -96,11 +98,12 @@ class Global : public v8::UniquePersistent<T> {
public:
inline Global() : v8::UniquePersistent<T>() {}

template<typename S> inline Global(v8::Local<S> that) :
template<typename S> inline explicit Global(v8::Local<S> that) :
v8::UniquePersistent<T>(v8::Isolate::GetCurrent(), that) {}

template<typename S>
inline Global(const v8::PersistentBase<S> &that) :
inline
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)

This comment was marked as off-topic.

v8::UniquePersistent<S>(v8::Isolate::GetCurrent(), that) {}

inline void Reset() { v8::PersistentBase<T>::Reset(); }
Expand Down
6 changes: 3 additions & 3 deletions nan_persistent_pre_12_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,20 @@ class Global : public PersistentBase<T> {
inline Global() : PersistentBase<T>(0) { }

template <typename S>
inline Global(v8::Local<S> that)
inline explicit Global(v8::Local<S> that)
: PersistentBase<T>(v8::Persistent<T>::New(that)) {
TYPE_CHECK(T, S);
}

template <typename S>
inline Global(const PersistentBase<S> &that)
inline Global(const PersistentBase<S> &that) // NOLINT(runtime/explicit)

This comment was marked as off-topic.

: PersistentBase<T>(that) {
TYPE_CHECK(T, S);
}
/**
* Move constructor.
*/
inline Global(RValue rvalue)
inline Global(RValue rvalue) // NOLINT(runtime/explicit)

This comment was marked as off-topic.

: PersistentBase<T>(rvalue.object->persistent) {
rvalue.object->Reset();
}
Expand Down