File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -83,12 +83,10 @@ _.define(
8383_ . define (
8484 arrayProto ,
8585 '$remove' ,
86- function $remove ( index ) {
86+ function $remove ( item ) {
8787 /* istanbul ignore if */
8888 if ( ! this . length ) return
89- if ( typeof index !== 'number' ) {
90- index = _ . indexOf ( this , index )
91- }
89+ var index = _ . indexOf ( this , item )
9290 if ( index > - 1 ) {
9391 return this . splice ( index , 1 )
9492 }
Original file line number Diff line number Diff line change @@ -153,11 +153,6 @@ describe('Observer', function () {
153153 var ob = Observer . create ( arr )
154154 var dep = ob . dep
155155 spyOn ( dep , 'notify' )
156- // remove by index
157- arr . $remove ( 0 )
158- expect ( arr . length ) . toBe ( 1 )
159- expect ( arr [ 0 ] ) . toBe ( obj2 )
160- expect ( dep . notify . calls . count ( ) ) . toBe ( 1 )
161156 // remove by identity, not in array
162157 arr . $remove ( obj1 )
163158 expect ( arr . length ) . toBe ( 1 )
You can’t perform that action at this time.
0 commit comments