|
24 | 24 |
|
25 | 25 | #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
26 | 26 |
|
| 27 | +#include <type_traits> // std::remove_reference |
27 | 28 | #include "memory_tracker.h"
|
28 | 29 | #include "v8.h"
|
29 |
| -#include <type_traits> // std::remove_reference |
30 | 30 |
|
31 | 31 | namespace node {
|
32 | 32 |
|
@@ -84,7 +84,7 @@ class BaseObject : public MemoryRetainer {
|
84 | 84 | template <int Field>
|
85 | 85 | static void InternalFieldGet(v8::Local<v8::String> property,
|
86 | 86 | const v8::PropertyCallbackInfo<v8::Value>& info);
|
87 |
| - template <int Field, bool (v8::Value::* typecheck)() const> |
| 87 | + template <int Field, bool (v8::Value::*typecheck)() const> |
88 | 88 | static void InternalFieldSet(v8::Local<v8::String> property,
|
89 | 89 | v8::Local<v8::Value> value,
|
90 | 90 | const v8::PropertyCallbackInfo<void>& info);
|
@@ -157,13 +157,11 @@ inline T* Unwrap(v8::Local<v8::Object> obj) {
|
157 | 157 | return BaseObject::FromJSObject<T>(obj);
|
158 | 158 | }
|
159 | 159 |
|
160 |
| - |
161 |
| -#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ |
162 |
| - do { \ |
163 |
| - *ptr = static_cast<typename std::remove_reference<decltype(*ptr)>::type>( \ |
164 |
| - BaseObject::FromJSObject(obj)); \ |
165 |
| - if (*ptr == nullptr) \ |
166 |
| - return __VA_ARGS__; \ |
| 160 | +#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ |
| 161 | + do { \ |
| 162 | + *ptr = static_cast<typename std::remove_reference<decltype(*ptr)>::type>( \ |
| 163 | + BaseObject::FromJSObject(obj)); \ |
| 164 | + if (*ptr == nullptr) return __VA_ARGS__; \ |
167 | 165 | } while (0)
|
168 | 166 |
|
169 | 167 | // Implementation of a generic strong or weak pointer to a BaseObject.
|
@@ -199,7 +197,7 @@ class BaseObjectPtrImpl final {
|
199 | 197 |
|
200 | 198 | private:
|
201 | 199 | union {
|
202 |
| - BaseObject* target; // Used for strong pointers. |
| 200 | + BaseObject* target; // Used for strong pointers. |
203 | 201 | BaseObject::PointerData* pointer_data; // Used for weak pointers.
|
204 | 202 | } data_;
|
205 | 203 |
|
|
0 commit comments