Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index fc528b679166b625cdba24f5fade1559e8ea93ce..51cd6c81fbca51c09645528293e35e9dc2eba43f 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -408,18 +408,22 @@ void V8::MakeWeak(i::Object** object, void* parameter, |
} |
-void V8::MakePhantom(i::Object** object, void* parameter, |
- PhantomCallbackData<void>::Callback weak_callback) { |
- i::GlobalHandles::MakePhantom(object, parameter, weak_callback); |
-} |
- |
- |
void V8::MakePhantom( |
- i::Object** object, |
- InternalFieldsCallbackData<void, void>::Callback weak_callback, |
- int internal_field_index1, int internal_field_index2) { |
- i::GlobalHandles::MakePhantom(object, weak_callback, internal_field_index1, |
- internal_field_index2); |
+ i::Object** object, void* parameter, int internal_field_index1, |
+ int internal_field_index2, |
+ PhantomCallbackData<void, void, void>::Callback weak_callback) { |
+ if (internal_field_index1 == 0) { |
+ if (internal_field_index2 == 1) { |
+ i::GlobalHandles::MakePhantom(object, parameter, 2, weak_callback); |
+ } else { |
+ DCHECK_EQ(internal_field_index2, Object::kNoInternalFieldIndex); |
+ i::GlobalHandles::MakePhantom(object, parameter, 1, weak_callback); |
+ } |
+ } else { |
+ DCHECK_EQ(internal_field_index1, Object::kNoInternalFieldIndex); |
+ DCHECK_EQ(internal_field_index2, Object::kNoInternalFieldIndex); |
+ i::GlobalHandles::MakePhantom(object, parameter, 0, weak_callback); |
+ } |
} |