()
| 12567 | } |
| 12568 | |
| 12569 | function $watchCollectionAction() { |
| 12570 | if (initRun) { |
| 12571 | initRun = false; |
| 12572 | listener(newValue, newValue, self); |
| 12573 | } else { |
| 12574 | listener(newValue, veryOldValue, self); |
| 12575 | } |
| 12576 | |
| 12577 | // make a copy for the next time a collection is changed |
| 12578 | if (trackVeryOldValue) { |
| 12579 | if (!isObject(newValue)) { |
| 12580 | //primitive |
| 12581 | veryOldValue = newValue; |
| 12582 | } else if (isArrayLike(newValue)) { |
| 12583 | veryOldValue = new Array(newValue.length); |
| 12584 | for (var i = 0; i < newValue.length; i++) { |
| 12585 | veryOldValue[i] = newValue[i]; |
| 12586 | } |
| 12587 | } else { // if object |
| 12588 | veryOldValue = {}; |
| 12589 | for (var key in newValue) { |
| 12590 | if (hasOwnProperty.call(newValue, key)) { |
| 12591 | veryOldValue[key] = newValue[key]; |
| 12592 | } |
| 12593 | } |
| 12594 | } |
| 12595 | } |
| 12596 | } |
| 12597 | |
| 12598 | return this.$watch($watchCollectionWatch, $watchCollectionAction); |
| 12599 | }, |
nothing calls this directly
no test coverage detected