aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ltable.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ltable.js b/src/ltable.js
index 025efe0..039dd6d 100644
--- a/src/ltable.js
+++ b/src/ltable.js
@@ -14,7 +14,9 @@ const TValue = lobject.TValue;
Table.prototype.ordered_intindexes = function() {
return [...this.value.keys()]
.filter(e => typeof e === 'number' && e % 1 === 0) // Only integer indexes
- .sort();
+ .sort(function (a, b) {
+ return a > b ? 1 : -1;
+ });
};
Table.prototype.ordered_indexes = function() {
@@ -73,4 +75,4 @@ Table.prototype.luaH_next = function(L, keyI) {
}
return 0;
-}; \ No newline at end of file
+};