Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 0a5c28c7be0ba6530b2056f49632af7dc1b2fd71..703df5d08b568706eeb66588d3bbf49fb93225f5 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -11656,7 +11656,13 @@ static int GetGlobalObjectsCount() { |
int count = 0; |
i::HeapIterator it(CcTest::heap()); |
for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) |
- if (object->IsJSGlobalObject()) count++; |
+ if (object->IsJSGlobalObject()) { |
+ i::JSGlobalObject* g = i::JSGlobalObject::cast(object); |
+ // Skip dummy global object. |
+ if (i::GlobalDictionary::cast(g->properties())->NumberOfElements() != 0) { |
+ count++; |
+ } |
+ } |
// Subtract one to compensate for the code stub context that is always present |
return count - 1; |
} |