Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index 6d17a9a25fac4bdf65da975bcdc7c9e67f3fe9b2..29432bb5b7c7782f60f9798239fcbe5602c018f5 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -235,7 +235,7 @@ class GlobalHandles::Node { |
void MakeWeak(GlobalHandles* global_handles, |
void* parameter, |
- WeakReferenceCallback weak_reference_callback, |
+ RevivableCallback weak_reference_callback, |
NearDeathCallback near_death_callback) { |
ASSERT(state() != FREE); |
set_state(WEAK); |
@@ -267,7 +267,7 @@ class GlobalHandles::Node { |
set_state(NEAR_DEATH); |
set_parameter(NULL); |
- v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle()); |
+ v8::Persistent<v8::Value> object = ToApi<v8::Value>(handle()); |
{ |
// Check that we are not passing a finalized external string to |
// the callback. |
@@ -279,9 +279,11 @@ class GlobalHandles::Node { |
VMState<EXTERNAL> state(isolate); |
if (near_death_callback_ != NULL) { |
if (IsWeakCallback::decode(flags_)) { |
- WeakReferenceCallback callback = |
- reinterpret_cast<WeakReferenceCallback>(near_death_callback_); |
- callback(object, par); |
+ RevivableCallback callback = |
+ reinterpret_cast<RevivableCallback>(near_death_callback_); |
+ callback(reinterpret_cast<v8::Isolate*>(isolate), |
+ &object, |
+ par); |
} else { |
near_death_callback_(reinterpret_cast<v8::Isolate*>(isolate), |
object, |
@@ -493,9 +495,9 @@ void GlobalHandles::Destroy(Object** location) { |
void GlobalHandles::MakeWeak(Object** location, |
void* parameter, |
- WeakReferenceCallback weak_reference_callback, |
+ RevivableCallback weak_reference_callback, |
NearDeathCallback near_death_callback) { |
- ASSERT(near_death_callback != NULL); |
+ ASSERT((weak_reference_callback == NULL) != (near_death_callback == NULL)); |
Node::FromLocation(location)->MakeWeak(this, |
parameter, |
weak_reference_callback, |