Index: test/cctest/test-weaksets.cc |
diff --git a/test/cctest/test-weaksets.cc b/test/cctest/test-weaksets.cc |
index a83e16b12b6bb5a4f0b491ad3560ec4b17007e57..0e1ef17c05ce139d4baf4fc3c64d7a514d55687d 100644 |
--- a/test/cctest/test-weaksets.cc |
+++ b/test/cctest/test-weaksets.cc |
@@ -46,10 +46,12 @@ static Handle<JSWeakSet> AllocateJSWeakSet(Isolate* isolate) { |
Handle<Map> map = factory->NewMap(JS_WEAK_SET_TYPE, JSWeakSet::kSize); |
Handle<JSObject> weakset_obj = factory->NewJSObjectFromMap(map); |
Handle<JSWeakSet> weakset(JSWeakSet::cast(*weakset_obj)); |
- // Do not use handles for the hash table, it would make entries strong. |
- Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1); |
- weakset->set_table(*table); |
- weakset->set_next(Smi::FromInt(0)); |
+ // Do not leak handles for the hash table, it would make entries strong. |
+ { |
+ HandleScope scope(isolate); |
+ Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1); |
+ weakset->set_table(*table); |
+ } |
return weakset; |
} |