()
| 16086 | } |
| 16087 | |
| 16088 | function $watchCollectionAction() { |
| 16089 | if (initRun) { |
| 16090 | initRun = false; |
| 16091 | listener(newValue, newValue, self); |
| 16092 | } else { |
| 16093 | listener(newValue, veryOldValue, self); |
| 16094 | } |
| 16095 | |
| 16096 | // make a copy for the next time a collection is changed |
| 16097 | if (trackVeryOldValue) { |
| 16098 | if (!isObject(newValue)) { |
| 16099 | //primitive |
| 16100 | veryOldValue = newValue; |
| 16101 | } else if (isArrayLike(newValue)) { |
| 16102 | veryOldValue = new Array(newValue.length); |
| 16103 | for (var i = 0; i < newValue.length; i++) { |
| 16104 | veryOldValue[i] = newValue[i]; |
| 16105 | } |
| 16106 | } else { // if object |
| 16107 | veryOldValue = {}; |
| 16108 | for (var key in newValue) { |
| 16109 | if (hasOwnProperty.call(newValue, key)) { |
| 16110 | veryOldValue[key] = newValue[key]; |
| 16111 | } |
| 16112 | } |
| 16113 | } |
| 16114 | } |
| 16115 | } |
| 16116 | |
| 16117 | return this.$watch(changeDetector, $watchCollectionAction); |
| 16118 | }, |
nothing calls this directly
no test coverage detected