()
| 18418 | } |
| 18419 | |
| 18420 | function $watchCollectionAction() { |
| 18421 | if (initRun) { |
| 18422 | initRun = false; |
| 18423 | listener(newValue, newValue, self); |
| 18424 | } else { |
| 18425 | listener(newValue, veryOldValue, self); |
| 18426 | } |
| 18427 | |
| 18428 | // make a copy for the next time a collection is changed |
| 18429 | if (trackVeryOldValue) { |
| 18430 | if (!isObject(newValue)) { |
| 18431 | //primitive |
| 18432 | veryOldValue = newValue; |
| 18433 | } else if (isArrayLike(newValue)) { |
| 18434 | veryOldValue = new Array(newValue.length); |
| 18435 | for (var i = 0; i < newValue.length; i++) { |
| 18436 | veryOldValue[i] = newValue[i]; |
| 18437 | } |
| 18438 | } else { // if object |
| 18439 | veryOldValue = {}; |
| 18440 | for (var key in newValue) { |
| 18441 | if (hasOwnProperty.call(newValue, key)) { |
| 18442 | veryOldValue[key] = newValue[key]; |
| 18443 | } |
| 18444 | } |
| 18445 | } |
| 18446 | } |
| 18447 | } |
| 18448 | |
| 18449 | return this.$watch(changeDetector, $watchCollectionAction); |
| 18450 | }, |
nothing calls this directly
no test coverage detected