()
| 18214 | } |
| 18215 | |
| 18216 | function $watchCollectionAction() { |
| 18217 | if (initRun) { |
| 18218 | initRun = false; |
| 18219 | listener(newValue, newValue, self); |
| 18220 | } else { |
| 18221 | listener(newValue, veryOldValue, self); |
| 18222 | } |
| 18223 | |
| 18224 | // make a copy for the next time a collection is changed |
| 18225 | if (trackVeryOldValue) { |
| 18226 | if (!isObject(newValue)) { |
| 18227 | //primitive |
| 18228 | veryOldValue = newValue; |
| 18229 | } else if (isArrayLike(newValue)) { |
| 18230 | veryOldValue = new Array(newValue.length); |
| 18231 | for (var i = 0; i < newValue.length; i++) { |
| 18232 | veryOldValue[i] = newValue[i]; |
| 18233 | } |
| 18234 | } else { // if object |
| 18235 | veryOldValue = {}; |
| 18236 | for (var key in newValue) { |
| 18237 | if (hasOwnProperty.call(newValue, key)) { |
| 18238 | veryOldValue[key] = newValue[key]; |
| 18239 | } |
| 18240 | } |
| 18241 | } |
| 18242 | } |
| 18243 | } |
| 18244 | |
| 18245 | return this.$watch(changeDetector, $watchCollectionAction); |
| 18246 | }, |
nothing calls this directly
no test coverage detected