From a63c5d9653635aecb6b300b8ac5a8a7d12e31d9f Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sun, 15 Jun 2025 17:23:13 +0800 Subject: [PATCH 1/4] fix babel tweaking out on 1.12 cli minification --- cli.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index c79fdcb..e60d1d3 100644 --- a/cli.js +++ b/cli.js @@ -33,7 +33,15 @@ async function main() { EFI.conf.doMinifyPlus = args.includes("/minify_extras"); EFI.conf.verbose = args.includes("/verbose"); const string = await fs.readFile(inputFile, {encoding: 'utf-8'}); - const res = await EFI.patchClient(string, new DOMParser()); + const bannedEscapeCodes = { //babel added support for every newline escape code in existence. browser javascript code can process these unescaped, but babel-cli can't + "\u2028": "\\u2028", + "\u0085": "\\u0085", + "\u2029": "\\u2029", + } + const res = await EFI.patchClient( + Object.entries(bannedEscapeCodes).reduce((acc, ent)=>acc.replaceAll(ent[0], ent[1]), string), + new DOMParser() + ); if (res) { var output = args[1]; if (!output || !output.endsWith(".html")) { From 6c764687022363cfa3f8465502babfb1176e10ef Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sun, 15 Jun 2025 17:23:42 +0800 Subject: [PATCH 2/4] bump npm ver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8b8fb69..0e21d1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eaglerforgeinjector", - "version": "2.7.93", + "version": "2.7.93b", "description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.", "main": "node.js", "directories": { From e02d7f225fdc98e8f1c13d4f6392aa2967535b6a Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sat, 28 Jun 2025 13:06:07 +0800 Subject: [PATCH 3/4] move uppercase reflect location --- core/postinit.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/postinit.js b/core/postinit.js index e6ae7e6..bde3869 100644 --- a/core/postinit.js +++ b/core/postinit.js @@ -351,12 +351,12 @@ const modapi_postinit = "(" + (() => { return ModAPI.hooks._teavm.$rt_createDoubleArray(size); } - //Proxy to make sure static variables are initialized before access. + //Proxy to make sure static variables are initialized before access, as well as fixing some issues in 1.12 function makeClinitProxy(staticVariables, clinit) { return new Proxy(staticVariables, { get: function (a, b, c) { clinit(); - return Reflect.get(a, b, c); + return Reflect.get(a, b, c) || Reflect.get(a, b.toUpperCase(), c); } }); } @@ -675,7 +675,6 @@ const modapi_postinit = "(" + (() => { get(target, prop, receiver) { var outProp = prop; var outputValue = Reflect.get(target, outProp, receiver); - outputValue ||= Reflect.get(target, outProp.toUpperCase(), receiver); //1.12 made a lot of variables uppercase (idk why) if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") { return new Proxy(outputValue.data, TeaVMArray_To_Recursive_BaseData_ProxyConf); } From 645970a98b1f716291ee759114dc03b1e84f5bc9 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sat, 28 Jun 2025 13:06:31 +0800 Subject: [PATCH 4/4] bump ver --- core/core.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core.js b/core/core.js index da4a1e4..24b308c 100644 --- a/core/core.js +++ b/core/core.js @@ -37,7 +37,7 @@ var modapi_preinit = `globalThis.ModAPI ||= {}; `; var freezeCallstack = `if(ModAPI.hooks.freezeCallstack){return false};`; const EFIConfig = { - ModAPIVersion: "v2.7.93", //also change in package.json + ModAPIVersion: "v2.7.94", //also change in package.json doEaglerforge: true, verbose: false, doServerExtras: false, diff --git a/package.json b/package.json index 0e21d1e..e010ea3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eaglerforgeinjector", - "version": "2.7.93b", + "version": "2.7.94", "description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.", "main": "node.js", "directories": {