This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Use SetPointerInInternalField

  • Loading branch information...
1 parent 98683d2 commit 5d42cc3a44f87e401edcff11971b10dfd2180f3c @ry ry committed Sep 9, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/node_object_wrap.h
View
@@ -26,8 +26,7 @@ class ObjectWrap {
{
assert(!handle.IsEmpty());
assert(handle->InternalFieldCount() > 0);
- return static_cast<T*>(v8::Handle<v8::External>::Cast(
- handle->GetInternalField(0))->Value());
+ return static_cast<T*>(handle->GetPointerFromInternalField(0));
}
v8::Persistent<v8::Object> handle_; // ro
@@ -38,7 +37,7 @@ class ObjectWrap {
assert(handle_.IsEmpty());
assert(handle->InternalFieldCount() > 0);
handle_ = v8::Persistent<v8::Object>::New(handle);
- handle_->SetInternalField(0, v8::External::New(this));
+ handle_->SetPointerInInternalField(0, this);
MakeWeak();
}

0 comments on commit 5d42cc3

Please sign in to comment.