Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test: fix up weakref.cc after v8 api change

  • Loading branch information...
commit dc29d64983f16fae79a9e293dbd3106bf69171db 1 parent f65e14e
@bnoordhuis bnoordhuis authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/gc/node_modules/weak/src/weakref.cc
View
12 test/gc/node_modules/weak/src/weakref.cc
@@ -37,7 +37,7 @@ Persistent<ObjectTemplate> proxyClass;
bool IsDead(Handle<Object> proxy) {
assert(proxy->InternalFieldCount() == 1);
proxy_container *cont = reinterpret_cast<proxy_container*>(
- proxy->GetPointerFromInternalField(0));
+ proxy->GetAlignedPointerFromInternalField(0));
return cont == NULL || cont->target.IsEmpty();
}
@@ -45,13 +45,13 @@ bool IsDead(Handle<Object> proxy) {
Handle<Object> Unwrap(Handle<Object> proxy) {
assert(!IsDead(proxy));
proxy_container *cont = reinterpret_cast<proxy_container*>(
- proxy->GetPointerFromInternalField(0));
+ proxy->GetAlignedPointerFromInternalField(0));
return cont->target;
}
Handle<Array> GetCallbacks(Handle<Object> proxy) {
proxy_container *cont = reinterpret_cast<proxy_container*>(
- proxy->GetPointerFromInternalField(0));
+ proxy->GetAlignedPointerFromInternalField(0));
assert(cont != NULL);
return cont->callbacks;
}
@@ -159,7 +159,7 @@ void TargetCallback(Persistent<Value> target, void* arg) {
}
}
- cont->proxy->SetPointerInInternalField(0, NULL);
+ cont->proxy->SetAlignedPointerInInternalField(0, NULL);
cont->proxy.Dispose();
cont->proxy.Clear();
cont->target.Dispose();
@@ -185,7 +185,7 @@ Handle<Value> Create(const Arguments& args) {
cont->callbacks = Persistent<Array>::New(Array::New());
cont->proxy = Persistent<Object>::New(proxyClass->NewInstance());
- cont->proxy->SetPointerInInternalField(0, cont);
+ cont->proxy->SetAlignedPointerInInternalField(0, cont);
cont->target.MakeWeak(cont, TargetCallback);
@@ -235,7 +235,7 @@ Handle<Value> IsNearDeath(const Arguments& args) {
Local<Object> proxy = args[0]->ToObject();
proxy_container *cont = reinterpret_cast<proxy_container*>(
- proxy->GetPointerFromInternalField(0));
+ proxy->GetAlignedPointerFromInternalField(0));
assert(cont != NULL);
Handle<Boolean> rtn = Boolean::New(cont->target.IsNearDeath());

2 comments on commit dc29d64

@TooTallNate

Thanks! Cherry-picked upstream.

Please sign in to comment.
Something went wrong with that request. Please try again.