Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 8c05ff8bdd3e07349b54771eed2d323b41614d74..a55e1ffda9d7c327407ad26d031cd8bea4a80e7d 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -15499,12 +15499,10 @@ Maybe<bool> JSObject::AddDataElement(Handle<JSObject> object, uint32_t index, |
ElementsAccessor* accessor = ElementsAccessor::ForKind(to); |
accessor->Add(object, index, value, attributes, new_capacity); |
- uint32_t new_length = old_length; |
- Handle<Object> new_length_handle; |
if (object->IsJSArray() && index >= old_length) { |
- new_length = index + 1; |
- new_length_handle = isolate->factory()->NewNumberFromUint(new_length); |
- JSArray::cast(*object)->set_length(*new_length_handle); |
+ Handle<Object> new_length = |
+ isolate->factory()->NewNumberFromUint(index + 1); |
+ JSArray::cast(*object)->set_length(*new_length); |
} |
return Just(true); |