Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commite9670d5

Browse files
committed
fix watcher accidentally clearing watcherList on teardown (fixvuejs#806)
1 parent7822d71 commite9670d5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎src/watcher.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ p.teardown = function () {
222222
// which can improve teardown performance.
223223
if(!this.vm._isBeingDestroyed){
224224
varlist=this.vm._watcherList
225-
list.splice(list.indexOf(this))
225+
vari=list.indexOf(this)
226+
if(i>-1){
227+
list.splice(i,1)
228+
}
226229
}
227230
for(varidinthis.deps){
228231
this.deps[id].removeSub(this)

‎test/unit/specs/directives/model_spec.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ if (_.inBrowser) {
233233
expect(opts[1].selected).toBe(false)
234234
// should teardown option watcher when unbind
235235
expect(vm._watcherList.length).toBe(2)
236-
vm._directives[0].unbind()
236+
vm._directives[0]._teardown()
237237
expect(vm._watcherList.length).toBe(0)
238238
done()
239239
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp