Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/core/observer/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ export default class Watcher {
const value = this.get()
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// Watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
isObject(value) ||
this.deep
isObject(value)
) {
// set new value
const oldValue = this.value
Expand Down
8 changes: 4 additions & 4 deletions src/core/util/next-tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ let pending = false

function flushCallbacks () {
pending = false
const copies = callbacks.slice(0)
callbacks.length = 0
for (let i = 0; i < copies.length; i++) {
copies[i]()
const currentLength = callbacks.length
const currentCallback = callbacks.splice(0)
for (let i = 0; i < currentLength; i++) {
currentCallback[i]()
}
}

Expand Down