Skip to content

Commit 7708474

Browse files
author
jossonsmith
committed
When packing *.js into *.z.js, some methods or fields are renamed. Solved this problem.
1 parent 4cd0a42 commit 7708474

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,8 +1626,15 @@ Clazz.decorateFunction = function (clazzFun, prefix, name) {
16261626
}
16271627

16281628
if (window["ClazzLoader"] != null) {
1629+
/*-# findClass -> fC #-*/
16291630
var node = ClazzLoader.findClass (qName);
1631+
/*-#
1632+
# ClazzNode.STATUS_KNOWN -> 1
1633+
#-*/
16301634
if (node != null && node.status == ClazzNode.STATUS_KNOWN) {
1635+
/*-#
1636+
# updateNode -> uN
1637+
#-*/
16311638
ClazzLoader.updateNode (node);
16321639
}
16331640
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
Clazz.load (["java.lang.CharSequence", "$.Comparable", "java.io.Serializable", "java.util.Comparator"], "java.lang.String", null, function () {
2-
if (String.$replace != null) { // already defined! Maybe ClazzLoader will try to load this again!
3-
return;
4-
}
2+
if (String.prototype.$replace == null) { // not defined yet! ClazzLoader may try to load this twice!
53
java.lang.String = String;
64
//Clazz.decorateAsType (String, "String", null, [java.io.Serializable, CharSequence, Comparable]);
75
Clazz.implementOf (String, [java.io.Serializable, CharSequence, Comparable]);
@@ -491,4 +489,5 @@ String.instantialize = function () {
491489
return s;
492490
}
493491
};
492+
} // end of String.prototype.$replace
494493
});

0 commit comments

Comments
 (0)