Skip to content

Commit f9e29ac

Browse files
committed
// BH 2025.10.16 minimizing missing package.js message
1 parent e7208f0 commit f9e29ac

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed
122 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
// Google closure compiler cannot handle Clazz.new or Clazz.super
99

10+
// BH 2025.10.16 minimizing missing package.js message
1011
// BH 2025.04.17 adds option for explicit directory for core files different from j2sPath/core
1112
// BH 2025.03.12 adds support for writable byte[] parameters in WASM
1213
// BH 2025.03.06 adds support for JNA+WASM, automated loading of Java native classes if WASM is available
@@ -2903,10 +2904,13 @@ var evaluate = function(file, js) {
29032904
else
29042905
new Function((J2S._strict ? '"use strict";':'')+js + ";//# sourceURL="+file)();
29052906
} catch (e) {
2906-
var s = "[Java2Script] The required class file \n\n" + file + (js.indexOf("data: no") ?
2907+
var s = "[Java2Script] " + (
2908+
file.indexOf("/core/package.js") >= 0
2909+
? file + " not found (ignored)"
2910+
: "The required class file \n\n" + file + (js.indexOf("data: no") ?
29072911
"\nwas not found.\n"
29082912
: "\ncould not be loaded. Script error: " + e.message + " \n\ndata:\n\n" + js) + "\n\n"
2909-
+ (e.stack ? e.stack : Clazz._getStackTrace());
2913+
+ (e.stack ? e.stack : Clazz._getStackTrace()));
29102914
Clazz._lastEvalError = s;
29112915
if (Clazz._isQuietLoad)
29122916
return;
@@ -3011,7 +3015,7 @@ Clazz.loadScript = function(file, nameForList) {
30113015
Clazz.ClassFilesLoaded.pop();
30123016
_Loader.onScriptLoaded(file, e, data);
30133017
var s = ""+e;
3014-
if (data.indexOf("Error") >= 0)
3018+
if (data && data.indexOf("Error") >= 0)
30153019
s = data;
30163020
if (s.indexOf("missing ] after element list")>= 0)
30173021
s = "File not found";

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14208,6 +14208,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
1420814208

1420914209
// Google closure compiler cannot handle Clazz.new or Clazz.super
1421014210

14211+
// BH 2025.10.16 minimizing missing package.js message
1421114212
// BH 2025.04.17 adds option for explicit directory for core files different from j2sPath/core
1421214213
// BH 2025.03.12 adds support for writable byte[] parameters in WASM
1421314214
// BH 2025.03.06 adds support for JNA+WASM, automated loading of Java native classes if WASM is available
@@ -17104,10 +17105,13 @@ var evaluate = function(file, js) {
1710417105
else
1710517106
new Function((J2S._strict ? '"use strict";':'')+js + ";//# sourceURL="+file)();
1710617107
} catch (e) {
17107-
var s = "[Java2Script] The required class file \n\n" + file + (js.indexOf("data: no") ?
17108+
var s = "[Java2Script] " + (
17109+
file.indexOf("/core/package.js") >= 0
17110+
? file + " not found (ignored)"
17111+
: "The required class file \n\n" + file + (js.indexOf("data: no") ?
1710817112
"\nwas not found.\n"
1710917113
: "\ncould not be loaded. Script error: " + e.message + " \n\ndata:\n\n" + js) + "\n\n"
17110-
+ (e.stack ? e.stack : Clazz._getStackTrace());
17114+
+ (e.stack ? e.stack : Clazz._getStackTrace()));
1711117115
Clazz._lastEvalError = s;
1711217116
if (Clazz._isQuietLoad)
1711317117
return;
@@ -17212,7 +17216,7 @@ Clazz.loadScript = function(file, nameForList) {
1721217216
Clazz.ClassFilesLoaded.pop();
1721317217
_Loader.onScriptLoaded(file, e, data);
1721417218
var s = ""+e;
17215-
if (data.indexOf("Error") >= 0)
17219+
if (data && data.indexOf("Error") >= 0)
1721617220
s = data;
1721717221
if (s.indexOf("missing ] after element list")>= 0)
1721817222
s = "File not found";

0 commit comments

Comments
 (0)