1
0
mirror of https://github.com/quinton-ashley/java2js synced 2024-12-29 10:11:54 +01:00
This commit is contained in:
Quinton Ashley 2022-04-25 14:40:11 -05:00
parent f122d89264
commit d1dbf3b6f2
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,11 @@ jdk.imports['java.util.Collections'].load = async () => {
}
};
Collections.shuffle = (list) => {
if (!list.size()) return;
list.sort(() => Math.random() - 0.5);
};
Collections.swap = (list, i, j) => {
const l = list;
l.set(i, l.set(j, l.get(i)));

View File

@ -1,6 +1,6 @@
{
"name": "java2js",
"version": "1.2.7",
"version": "1.2.8",
"description": "Converts Java to JavaScript and runs it with a JS JDK",
"main": "jdk.js",
"scripts": {