()
| 15543 | } |
| 15544 | |
| 15545 | function $watchCollectionAction() { |
| 15546 | if (initRun) { |
| 15547 | initRun = false; |
| 15548 | listener(newValue, newValue, self); |
| 15549 | } else { |
| 15550 | listener(newValue, veryOldValue, self); |
| 15551 | } |
| 15552 | |
| 15553 | // make a copy for the next time a collection is changed |
| 15554 | if (trackVeryOldValue) { |
| 15555 | if (!isObject(newValue)) { |
| 15556 | //primitive |
| 15557 | veryOldValue = newValue; |
| 15558 | } else if (isArrayLike(newValue)) { |
| 15559 | veryOldValue = new Array(newValue.length); |
| 15560 | for (var i = 0; i < newValue.length; i++) { |
| 15561 | veryOldValue[i] = newValue[i]; |
| 15562 | } |
| 15563 | } else { // if object |
| 15564 | veryOldValue = {}; |
| 15565 | for (var key in newValue) { |
| 15566 | if (hasOwnProperty.call(newValue, key)) { |
| 15567 | veryOldValue[key] = newValue[key]; |
| 15568 | } |
| 15569 | } |
| 15570 | } |
| 15571 | } |
| 15572 | } |
| 15573 | |
| 15574 | return this.$watch(changeDetector, $watchCollectionAction); |
| 15575 | }, |
nothing calls this directly
no test coverage detected