Index: test/cctest/test-weaksets.cc |
diff --git a/test/cctest/test-weaksets.cc b/test/cctest/test-weaksets.cc |
index 9fa44c826d48626b72bdd65b3afddd67ceb6b3d3..a3a94789736acbfd74af5c956c8aa619eeb5e5f8 100644 |
--- a/test/cctest/test-weaksets.cc |
+++ b/test/cctest/test-weaksets.cc |
@@ -43,14 +43,12 @@ static Isolate* GetIsolateFrom(LocalContext* context) { |
static Handle<JSWeakSet> AllocateJSWeakSet(Isolate* isolate) { |
Factory* factory = isolate->factory(); |
- Heap* heap = isolate->heap(); |
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. |
- Object* table_obj = ObjectHashTable::Allocate(heap, 1)->ToObjectChecked(); |
- ObjectHashTable* table = ObjectHashTable::cast(table_obj); |
- weakset->set_table(table); |
+ Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1); |
+ weakset->set_table(*table); |
weakset->set_next(Smi::FromInt(0)); |
return weakset; |
} |