|
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 |
|
@@ -88,7 +88,7 @@ class BaseObject : public MemoryRetainer { |
88 | 88 | template <int Field> |
89 | 89 | static void InternalFieldGet(v8::Local<v8::String> property, |
90 | 90 | const v8::PropertyCallbackInfo<v8::Value>& info); |
91 | | - template <int Field, bool (v8::Value::* typecheck)() const> |
| 91 | + template <int Field, bool (v8::Value::*typecheck)() const> |
92 | 92 | static void InternalFieldSet(v8::Local<v8::String> property, |
93 | 93 | v8::Local<v8::Value> value, |
94 | 94 | const v8::PropertyCallbackInfo<void>& info); |
@@ -205,13 +205,11 @@ inline T* Unwrap(v8::Local<v8::Value> obj) { |
205 | 205 | return BaseObject::FromJSObject<T>(obj); |
206 | 206 | } |
207 | 207 |
|
208 | | - |
209 | | -#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ |
210 | | - do { \ |
211 | | - *ptr = static_cast<typename std::remove_reference<decltype(*ptr)>::type>( \ |
212 | | - BaseObject::FromJSObject(obj)); \ |
213 | | - if (*ptr == nullptr) \ |
214 | | - return __VA_ARGS__; \ |
| 208 | +#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ |
| 209 | + do { \ |
| 210 | + *ptr = static_cast<typename std::remove_reference<decltype(*ptr)>::type>( \ |
| 211 | + BaseObject::FromJSObject(obj)); \ |
| 212 | + if (*ptr == nullptr) return __VA_ARGS__; \ |
215 | 213 | } while (0) |
216 | 214 |
|
217 | 215 | // Implementation of a generic strong or weak pointer to a BaseObject. |
@@ -252,7 +250,7 @@ class BaseObjectPtrImpl final { |
252 | 250 |
|
253 | 251 | private: |
254 | 252 | union { |
255 | | - BaseObject* target; // Used for strong pointers. |
| 253 | + BaseObject* target; // Used for strong pointers. |
256 | 254 | BaseObject::PointerData* pointer_data; // Used for weak pointers. |
257 | 255 | } data_; |
258 | 256 |
|
|
0 commit comments