Skip to content

Commit

Permalink
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/array/element_set_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Array#[]= sets elements in the range arguments when passed ranges
fails:Array#[]= calls to_ary on its rhs argument for multi-element sets
Original file line number Diff line number Diff line change
@@ -464,6 +464,15 @@ public Object setOtherArray(VirtualFrame frame, DynamicObject array, int rawStar
for (int i = 0; i < tailSize; i++) {
write(array, endOfReplacementInArray + i, read(tailCopy, i));
}
} else {
// If no tail, array will grow, and the replacement is empty,
// we need to append nils from index arraySize to index (start - 1).
// E.g. a = [1,2,3]; a[5,1] = []; a == [1,2,3,nil,nil]
if(replacementSize == 0 && arraySize < start){
for(int i = arraySize; i < start; i++){
write(array, i, nil());
}
}
}

// Set size

0 comments on commit 5770682

Please sign in to comment.