Skip to content

Commit 5d42cc3

Browse files
committed
Use SetPointerInInternalField
1 parent 98683d2 commit 5d42cc3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/node_object_wrap.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class ObjectWrap {
2626
{
2727
assert(!handle.IsEmpty());
2828
assert(handle->InternalFieldCount() > 0);
29-
return static_cast<T*>(v8::Handle<v8::External>::Cast(
30-
handle->GetInternalField(0))->Value());
29+
return static_cast<T*>(handle->GetPointerFromInternalField(0));
3130
}
3231

3332
v8::Persistent<v8::Object> handle_; // ro
@@ -38,7 +37,7 @@ class ObjectWrap {
3837
assert(handle_.IsEmpty());
3938
assert(handle->InternalFieldCount() > 0);
4039
handle_ = v8::Persistent<v8::Object>::New(handle);
41-
handle_->SetInternalField(0, v8::External::New(this));
40+
handle_->SetPointerInInternalField(0, this);
4241
MakeWeak();
4342
}
4443

0 commit comments

Comments
 (0)