diff --git a/test/gc/node_modules/weak/src/weakref.cc b/test/gc/node_modules/weak/src/weakref.cc index c2267a0709..6906142860 100644 --- a/test/gc/node_modules/weak/src/weakref.cc +++ b/test/gc/node_modules/weak/src/weakref.cc @@ -134,8 +134,8 @@ void AddCallback(Handle proxy, Handle callback) { } -void TargetCallback(Persistent target, void* arg) { - HandleScope scope; +void TargetCallback(Isolate* isolate, Persistent target, void* arg) { + HandleScope scope(isolate); assert(target.IsNearDeath()); @@ -187,7 +187,9 @@ Handle Create(const Arguments& args) { cont->proxy = Persistent::New(proxyClass->NewInstance()); cont->proxy->SetAlignedPointerInInternalField(0, cont); - cont->target.MakeWeak(cont, TargetCallback); + cont->target.MakeWeak(Isolate::GetCurrent(), + static_cast(cont), + TargetCallback); if (args.Length() >= 2) { AddCallback(cont->proxy, Handle::Cast(args[1]));