siggame / Viseur

Visualizer for the Cadre AI game framework
http://vis.siggame.io
MIT License
5 stars 9 forks source link

Is Max.max a typo? #9

Closed russleyshaw closed 8 years ago

russleyshaw commented 8 years ago

Should this be Math.max? https://github.com/siggame/Viseur/blob/ccc73741ee1bb73e6e562e5c755c571e6d2424b2/extensions/array.js#L40

    last: function(offset) {
        offset = Max.max(Math.abs(offset || 0), this.length);
        return this[this.length - 1 - offset];
    },
JacobFischer commented 8 years ago

Yeah almost certainly. Should be Math.min(...) to bound the offset between 0 and length-1.

That being said these prototype extensions are copied from siggame/Cerveau, and also copied into Joueur.js. I think I'll move the extensions into an npm module for all three projects to use, that way errors don't get fixed in one repo but not propagated to the others.

I'll close this issue when that's done.