mirror of
https://github.com/quinton-ashley/java2js
synced 2024-12-29 10:11:54 +01:00
1.2.21
This commit is contained in:
parent
e7e62c6ac8
commit
86c75f78c8
5
jdk.js
5
jdk.js
@ -165,6 +165,9 @@
|
||||
'java2js error: JDK not initialized! You must call `await jdk.init()` before using `jdk.load()`'
|
||||
);
|
||||
}
|
||||
|
||||
file = file.replaceAll(/\s+{/gm, ' {');
|
||||
|
||||
// bodge fix to avoid getting the index of a commented out class
|
||||
// (only works with normal comments)
|
||||
let classLine = file.indexOf('\npublic class');
|
||||
@ -178,8 +181,6 @@
|
||||
|
||||
let className = file.slice(classLine + 13, file.indexOf('{', classLine + 13));
|
||||
|
||||
file = file.replaceAll(/\s+{/gm, ' {');
|
||||
|
||||
// workaround hack for converting triple quotes to a normal string
|
||||
file = file.replace(/"""([^"]*)"""/gm, (match, p1) => {
|
||||
return '(' + p1.replace(/( |\t){0,3}(.*)(\r*\n|$)/gm, '"$2\\n"+').slice(0, -1) + ')';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "java2js",
|
||||
"version": "1.2.20",
|
||||
"version": "1.2.21",
|
||||
"description": "Converts Java to JavaScript and runs it with a JS JDK",
|
||||
"main": "jdk.js",
|
||||
"scripts": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user