We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7822d71 commit e9670d5Copy full SHA for e9670d5
src/watcher.js
@@ -222,7 +222,10 @@ p.teardown = function () {
222
// which can improve teardown performance.
223
if (!this.vm._isBeingDestroyed) {
224
var list = this.vm._watcherList
225
- list.splice(list.indexOf(this))
+ var i = list.indexOf(this)
226
+ if (i > -1) {
227
+ list.splice(i, 1)
228
+ }
229
}
230
for (var id in this.deps) {
231
this.deps[id].removeSub(this)
test/unit/specs/directives/model_spec.js
@@ -233,7 +233,7 @@ if (_.inBrowser) {
233
expect(opts[1].selected).toBe(false)
234
// should teardown option watcher when unbind
235
expect(vm._watcherList.length).toBe(2)
236
- vm._directives[0].unbind()
+ vm._directives[0]._teardown()
237
expect(vm._watcherList.length).toBe(0)
238
done()
239
})
0 commit comments