On Thu, Mar 29, 2012 at 10:20 PM, Brendan Eich <[email protected]> wrote: > Peter Michaux wrote: >> >> I've worked on a generic Set polyfill. It is quite a simple task to >> build one but determining if an object is in the set is O(n) with the >> following "has" method. >> >> Set.prototype.has = function(element) { >> for (var i = 0, ilen = this._elements.length; i< ilen; i++) { >> if (element === this._elements[i]) { > > > You need Object.is here, not ===, per > > http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets > > Object.is spec: > > http://wiki.ecmascript.org/doku.php?id=harmony:egal
Thanks for mentioning this. What is the license on the "is" function implementation shown in the wiki? I'd like to include it in a file that is 2-clause BSD licensed. I see the wiki itself is under the CC non-commercial license which seems incompatible. Peter _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

