Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 31f877284ef72b3e3a0dc6651c078b19d4cbffa9..f0c105cffc9817c8e302b9b06f92b771eec3246d 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -567,21 +567,29 @@ void V8::MakeWeak(i::Object** object, void* parameter, |
} |
-void V8::MakePhantom(i::Object** object, void* parameter, |
- int internal_field_index1, int internal_field_index2, |
- PhantomCallbackData<void>::Callback weak_callback) { |
+void V8::MakeWeak(i::Object** object, void* parameter, |
+ int internal_field_index1, int internal_field_index2, |
+ WeakCallbackInfo<void>::Callback weak_callback) { |
+ WeakCallbackType type = WeakCallbackType::kParameter; |
if (internal_field_index1 == 0) { |
if (internal_field_index2 == 1) { |
- i::GlobalHandles::MakePhantom(object, parameter, 2, weak_callback); |
+ type = WeakCallbackType::kInternalFields; |
} else { |
- DCHECK_EQ(internal_field_index2, kNoInternalFieldIndex); |
- i::GlobalHandles::MakePhantom(object, parameter, 1, weak_callback); |
+ DCHECK_EQ(internal_field_index2, -1); |
+ type = WeakCallbackType::kInternalFields; |
} |
} else { |
- DCHECK_EQ(internal_field_index1, kNoInternalFieldIndex); |
- DCHECK_EQ(internal_field_index2, kNoInternalFieldIndex); |
- i::GlobalHandles::MakePhantom(object, parameter, 0, weak_callback); |
+ DCHECK_EQ(internal_field_index1, -1); |
+ DCHECK_EQ(internal_field_index2, -1); |
} |
+ i::GlobalHandles::MakeWeak(object, parameter, weak_callback, type); |
+} |
+ |
+ |
+void V8::MakeWeak(i::Object** object, void* parameter, |
+ WeakCallbackInfo<void>::Callback weak_callback, |
+ WeakCallbackType type) { |
+ i::GlobalHandles::MakeWeak(object, parameter, weak_callback, type); |
} |