mobx 6.3.7 → 6.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3685,9 +3685,12 @@
3685
3685
 
3686
3686
  return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));
3687
3687
  } else {
3688
- var res = this.values_.slice(index, index + deleteCount);
3689
- var oldItems = this.values_.slice(index + deleteCount);
3690
- this.values_.length = index + newItems.length - deleteCount;
3688
+ // The items removed by the splice
3689
+ var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array
3690
+
3691
+ var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count
3692
+
3693
+ this.values_.length += newItems.length - deleteCount;
3691
3694
 
3692
3695
  for (var i = 0; i < newItems.length; i++) {
3693
3696
  this.values_[index + i] = newItems[i];