Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index 1a0c982936f7b45e2fd305a1cee75b8e09171c82..e4bb925f0e9299ea105df757004d0912dad893b0 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -168,6 +168,12 @@ class GlobalHandles::Node : public Malloced { |
if (first_deallocated()) { |
first_deallocated()->set_next(head()); |
} |
+ // Check that we are not passing a finalized external string to |
+ // the callback. |
+ ASSERT(!object_->IsExternalAsciiString() || |
+ ExternalAsciiString::cast(object_)->resource() != NULL); |
+ ASSERT(!object_->IsExternalTwoByteString() || |
+ ExternalTwoByteString::cast(object_)->resource() != NULL); |
// Leaving V8. |
VMState state(EXTERNAL); |
func(object, par); |
@@ -507,5 +513,4 @@ void GlobalHandles::RemoveObjectGroups() { |
object_groups->Clear(); |
} |
- |
} } // namespace v8::internal |