Skip to content

Commit 1eafc06

Browse files
author
zhourenjian
committed
Fixed bug that ClassLoader does not call optionasLoaded in some scenarios.
1 parent eadbb3a commit 1eafc06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/net.sf.j2s.java.core/src/java/lang/ClassLoader.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ ClazzLoader.tryToLoadNext = function (file) {
12831283
* Here when loading entry class, ClassLoader should not call
12841284
* the next following loading script. This is because, those
12851285
* scripts will try to mark the class as loaded directly and
1286-
* then continue to call #optionalLoaded callback method,
1286+
* then continue to call #optionalsLoaded callback method,
12871287
* which results in an script error!
12881288
*/
12891289
ClazzLoader.isLoadingEntryClass = false;
@@ -1352,6 +1352,12 @@ ClazzLoader.tryToLoadNext = function (file) {
13521352
for (var i = 0; i < dList.length; i++) {
13531353
ClazzLoader.updateNode (dList[i]);
13541354
}
1355+
for (var i = 0; i < dList.length; i++) {
1356+
if (dList[i].optionalsLoaded != null) {
1357+
dList[i].optionalsLoaded ();
1358+
dList[i].optionalsLoaded = null;
1359+
}
1360+
}
13551361

13561362
/*
13571363
* It seems ClazzLoader#globalLoaded is seldom overrided.

0 commit comments

Comments
 (0)