File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,11 @@ describe('List', () => {
722
722
expect ( o . get ( 0 ) ) . toBe ( 'f' ) ;
723
723
} ) ;
724
724
725
+ it ( 'works with push and insert without phantom values' , ( ) => {
726
+ const v = List . of ( ) . set ( 287 , 287 ) . push ( 42 ) . insert ( 33 , 33 ) ;
727
+ expect ( v . toJS ( ) . filter ( item => item === 287 ) ) . toHaveLength ( 1 ) ;
728
+ } ) ;
729
+
725
730
// TODO: assert that findIndex only calls the function as much as it needs to.
726
731
727
732
it ( 'forEach iterates in the correct order' , ( ) => {
Original file line number Diff line number Diff line change @@ -304,7 +304,10 @@ class VNode {
304
304
}
305
305
306
306
removeAfter ( ownerID , level , index ) {
307
- if ( index === ( level ? 1 << level : 0 ) || this . array . length === 0 ) {
307
+ if (
308
+ index === ( level ? 1 << ( level + 1 ) : SIZE ) - 1 ||
309
+ this . array . length === 0
310
+ ) {
308
311
return this ;
309
312
}
310
313
const sizeIndex = ( ( index - 1 ) >>> level ) & MASK ;
You can’t perform that action at this time.
0 commit comments