File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,10 @@ p.teardown = function () {
222
222
// which can improve teardown performance.
223
223
if ( ! this . vm . _isBeingDestroyed ) {
224
224
var list = this . vm . _watcherList
225
- list . splice ( list . indexOf ( this ) )
225
+ var i = list . indexOf ( this )
226
+ if ( i > - 1 ) {
227
+ list . splice ( i , 1 )
228
+ }
226
229
}
227
230
for ( var id in this . deps ) {
228
231
this . deps [ id ] . removeSub ( this )
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ if (_.inBrowser) {
233
233
expect ( opts [ 1 ] . selected ) . toBe ( false )
234
234
// should teardown option watcher when unbind
235
235
expect ( vm . _watcherList . length ) . toBe ( 2 )
236
- vm . _directives [ 0 ] . unbind ( )
236
+ vm . _directives [ 0 ] . _teardown ( )
237
237
expect ( vm . _watcherList . length ) . toBe ( 0 )
238
238
done ( )
239
239
} )
You can’t perform that action at this time.
0 commit comments