MCPcopy Create free account
hub / github.com/nodejs/nan / Unwrap

Method Unwrap

nan_object_wrap.h:30–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29 template <class T>
30 static inline T* Unwrap(v8::Local<v8::Object> object) {
31 assert(!object.IsEmpty());
32 assert(object->InternalFieldCount() > 0);
33 // Cast to ObjectWrap before casting to T. A direct cast from void
34 // to T won't work right when T has more than one base class.
35 void* ptr = GetInternalFieldPointer(object, 0);
36 ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
37 return static_cast<T*>(wrap);
38 }
39
40
41 inline v8::Local<v8::Object> handle() const {

Callers

nothing calls this directly

Calls 2

GetInternalFieldPointerFunction · 0.85
IsEmptyMethod · 0.45

Tested by

no test coverage detected