Skip to content

Commit 60a2338

Browse files
iamstoliswoess
authored andcommitted
Filling holes (and updating hole count) in addRangeImplContiguous().
1 parent f54a118 commit 60a2338

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/array/dyn/AbstractWritableArray.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ ScriptArray addRangeImplContiguous(JSDynamicObject object, long offset, int size
680680
int copySize = (lastIndex - effectiveOffset);
681681
if (copySize > 0) {
682682
System.arraycopy(array, effectiveOffset, array, (effectiveOffset + size), copySize);
683+
fillWithHoles(array, effectiveOffset, effectiveOffset + size);
684+
if (isHolesType()) {
685+
arraySetHoleCount(object, arrayGetHoleCount(object) + size);
686+
}
683687
}
684688
arraySetUsedLength(object, usedLength + size);
685689
return this;

0 commit comments

Comments
 (0)