Problem
The splice method in Neo.collection.Base was unconditionally assigning the initialIndexSymbol to all added items if they didn't already have it.
if (!Object.hasOwn(item, initialIndexSymbol)) {
item[initialIndexSymbol] = me.initialIndexCounter++
}
This caused plain objects in generic collections to be polluted with this symbol, leading to unit test failures in Neo.collection.Base.
Solution
Invert the logic to only assign the index counter if the item already possesses the symbol key (which Neo.data.Record instances do, initialized to null).
if (Object.hasOwn(item, initialIndexSymbol)) {
item[initialIndexSymbol] = me.initialIndexCounter++
}
This ensures the feature is "opt-in" and works correctly for Neo.data.Store (where records have the symbol) while ignoring plain objects in standard collections.
Problem
The
splicemethod inNeo.collection.Basewas unconditionally assigning theinitialIndexSymbolto all added items if they didn't already have it.// Previous Logic if (!Object.hasOwn(item, initialIndexSymbol)) { item[initialIndexSymbol] = me.initialIndexCounter++ }This caused plain objects in generic collections to be polluted with this symbol, leading to unit test failures in
Neo.collection.Base.Solution
Invert the logic to only assign the index counter if the item already possesses the symbol key (which
Neo.data.Recordinstances do, initialized tonull).// New Logic if (Object.hasOwn(item, initialIndexSymbol)) { item[initialIndexSymbol] = me.initialIndexCounter++ }This ensures the feature is "opt-in" and works correctly for
Neo.data.Store(where records have the symbol) while ignoring plain objects in standard collections.