Array.sort inconsistency

Hey guys,

I've been implementing a topological sorting algorithm for my isometric plugin (an old preview is available here), which works fine in Firefox but goes completely crazy when I run the stand alone app. After investigating, I've discovered that it seems to come from the Array.sort() function which seems to have a strange behaviour in the RMMV stand alone. Here is a screenshot of a little experiment I did in the developer tools of the stand alone app:

[IMG]http://www.atl3d.com/wp-content/uploads/2016/01/sort_function.jpg[/IMG]

It should just work, and in Firefox it does, but not in RMMV standalone. Anyone else is having this issue?
Cheers.
Your sort function needs to return an integer, not a boolean, see here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

The correct function for sorting numbers is

Code:
function compareNumbers(a,  {  return a - b;}
Yeah, I realized it 5 minutes after posting it, quite a stupid mistake ^^'. Still, it's strange that it even worked in Firefox in the first place, I imagine it was converting the boolean to an int.

Original thread: https://forums.rpgmakerweb.com/threads/array-sort-inconsistency.54277/