()
| 16522 | } |
| 16523 | |
| 16524 | function $watchCollectionAction() { |
| 16525 | if (initRun) { |
| 16526 | initRun = false; |
| 16527 | listener(newValue, newValue, self); |
| 16528 | } else { |
| 16529 | listener(newValue, veryOldValue, self); |
| 16530 | } |
| 16531 | |
| 16532 | // make a copy for the next time a collection is changed |
| 16533 | if (trackVeryOldValue) { |
| 16534 | if (!isObject(newValue)) { |
| 16535 | //primitive |
| 16536 | veryOldValue = newValue; |
| 16537 | } else if (isArrayLike(newValue)) { |
| 16538 | veryOldValue = new Array(newValue.length); |
| 16539 | for (var i = 0; i < newValue.length; i++) { |
| 16540 | veryOldValue[i] = newValue[i]; |
| 16541 | } |
| 16542 | } else { // if object |
| 16543 | veryOldValue = {}; |
| 16544 | for (var key in newValue) { |
| 16545 | if (hasOwnProperty.call(newValue, key)) { |
| 16546 | veryOldValue[key] = newValue[key]; |
| 16547 | } |
| 16548 | } |
| 16549 | } |
| 16550 | } |
| 16551 | } |
| 16552 | |
| 16553 | return this.$watch(changeDetector, $watchCollectionAction); |
| 16554 | }, |
nothing calls this directly
no test coverage detected