Index: test/cctest/test-weakmaps.cc |
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc |
index 5eef21449eaf9be8210eed1260e64be6bd25959d..14a5e020a140e919af267386aa79c8f104052b98 100644 |
--- a/test/cctest/test-weakmaps.cc |
+++ b/test/cctest/test-weakmaps.cc |
@@ -43,14 +43,12 @@ static Isolate* GetIsolateFrom(LocalContext* context) { |
static Handle<JSWeakMap> AllocateJSWeakMap(Isolate* isolate) { |
Factory* factory = isolate->factory(); |
- Heap* heap = isolate->heap(); |
Handle<Map> map = factory->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize); |
Handle<JSObject> weakmap_obj = factory->NewJSObjectFromMap(map); |
Handle<JSWeakMap> weakmap(JSWeakMap::cast(*weakmap_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); |
- weakmap->set_table(table); |
+ Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1); |
+ weakmap->set_table(*table); |
weakmap->set_next(Smi::FromInt(0)); |
return weakmap; |
} |