Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 5e38d06a8fda45816b5cd2733cafc6787fedf77f..556f2b01b793bc11c45a1c0a1f094e57b02ff835 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -950,6 +950,9 @@ Handle<JSObject> Factory::NewJSObjectFromMap(Handle<Map> map) { |
Handle<JSArray> Factory::NewJSArray(int capacity, |
ElementsKind elements_kind, |
PretenureFlag pretenure) { |
+ if (capacity != 0) { |
+ elements_kind = GetHoleyElementsKind(elements_kind); |
+ } |
CALL_HEAP_FUNCTION(isolate(), |
isolate()->heap()->AllocateJSArrayAndStorage( |
elements_kind, |