montagejs / collections

This package contains JavaScript implementations of common data structures with idiomatic interfaces.
http://www.collectionsjs.com
Other
2.09k stars 185 forks source link

collections breaks Array#find behavior #165

Closed erossignon closed 6 years ago

erossignon commented 7 years ago

Spotted here https://github.com/node-opcua/node-opcua/issues/248

Collections v5.0.5 seems to break and replace some Array methods, introducing breaking changes.

How to reproduce:

var a = ["e1","e2","e3"];
console.log(" before   ", a.find(function(e) { return e=="e1";}));
var collections = require("collections/shim-array");
console.log(" after    ", a.find(function(e) { return e=="e1";}));
codebling commented 7 years ago

See also #162, #116, #95 and #94

stevenvachon commented 7 years ago

Seriously, this stupid module is breaking my code. Please unpublish.

kriskowal commented 7 years ago

For what it's worth, I'm sorry.

kriskowal commented 7 years ago

It's worth noting that this issue is fixed in version 2, but walked backward in version 3 and I think 4. It might be good for the collections community for the version of this library with the "latest" tag in npm is one that fixes this problem and that legacy applications should pin to the legacy versions.

hthetiot commented 6 years ago

Duplicate #185

codebling commented 5 years ago

See also issues #36 #70 #94 #95 #116 #139 #145 #162 #165 #169 #178 #182 #185 #197 #215 #220 and PRs #94 #95 #116 #173 #189 #212. Branch v2 fixes these issues by avoiding global object modification.