| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -410,7 +410,7 @@ export const test_ObservableArray_spliceShouldRemoveAndInertSpecifiedNumberOfEle | |||
| 410 | 410 | // args.action is "splice". | |
| 411 | 411 | // args.index is the start index. | |
| 412 | 412 | // args.removed.length is equal to the number of deleted items. | |
| 413 | - // args.addedCount is equal to the delta between number of inserted items and number of deleted items but not less than 0. | ||
| 413 | + // args.addedCount is equal to the amount of added and replaced items. | ||
| 414 | 414 | ||
| 415 | 415 | // >> (hide) | |
| 416 | 416 | result = args; | |
@@ -421,7 +421,7 @@ export const test_ObservableArray_spliceShouldRemoveAndInertSpecifiedNumberOfEle | |||
| 421 | 421 | // << observable-array-splice-args-change | |
| 422 | 422 | ||
| 423 | 423 | TKUnit.assert(result.eventName === ObservableArray.changeEvent && result.action === ChangeType.Splice && | |
| 424 | - result.removed.length === 2 && result.index === 1 && result.addedCount === 1, "ObservableArray splice() should raise 'change' event with correct args!"); | ||
| 424 | + result.removed.length === 2 && result.index === 1 && result.addedCount === 3, "ObservableArray splice() should raise 'change' event with correct args!"); | ||
| 425 | 425 | }; | |
| 426 | 426 | ||
| 427 | 427 | export const test_ObservableArray_unshiftShouldInsertNewElementsFromTheStart = function () { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,7 +207,7 @@ export class ObservableArray<T> extends observable.Observable implements observa | |||
| 207 | 207 | action: ChangeType.Splice, | |
| 208 | 208 | index: start, | |
| 209 | 209 | removed: result, | |
| 210 | - addedCount: this._array.length > length ? this._array.length - length : 0 | ||
| 210 | + addedCount: this._array.length + result.length - length | ||
| 211 | 211 | }); | |
| 212 | 212 | if (this._array.length !== length) { | |
| 213 | 213 | this._notifyLengthChange(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments