|
31 | 31 | // TODO: superclass inheritance for JAXB XmlAccessorType |
32 | 32 | // TODO: Transpiler bug allows static String name, but JavaScript function().name is read-only and will be "clazz" |
33 | 33 |
|
| 34 | +//BH 2025.03.21 -- 5.0.1-v7 adds @j2sAlias with no name as "strip $"; does not account for multiple versions (could be done at runtime) |
34 | 35 | //BH 2025.03.05 -- 5.0.1-v6 adds native interface methods for WASM |
35 | 36 | //BH 2025.02.22 -- 5.0.1-v5 fixes Iterable<IAtom> AtomIterator::new missing [this,null] in generator |
36 | 37 | //BH 2024.07.14 -- 5.0.1-v4 fixes numerical array initializer using characters ['a','b',...], but not new int[] { "test".charAt(3) } |
@@ -5706,8 +5707,15 @@ String getMethodNameWithSyntheticBridgeForDeclaration(IMethodBinding mBinding, b |
5706 | 5707 | // $O$O$O for lambda as well |
5707 | 5708 | names.add(getFinalMethodNameWith$Params(methodName, mBinding, null, false, mtype)); |
5708 | 5709 | } |
5709 | | - if (alias != null) |
5710 | | - names.add(alias); |
| 5710 | + if (alias != null) { |
| 5711 | + if (alias.length() == 0) { |
| 5712 | + int pt = methodName.indexOf("$"); |
| 5713 | + if (pt != 0) |
| 5714 | + names.add(pt < 0 ? methodName : methodName.substring(0, pt)); |
| 5715 | + } else { |
| 5716 | + names.add(alias); |
| 5717 | + } |
| 5718 | + } |
5711 | 5719 | if ((mode & METHOD_ADD_GENERIC) != 0) { |
5712 | 5720 | // interesting case of this in Test_ClassBase, where different interfaces and |
5713 | 5721 | // the superclass |
@@ -6236,7 +6244,7 @@ private String checkJ2SMethodDoc(MethodDeclaration node) { |
6236 | 6244 | if (tags == null || tags.size() == 0 || (tag = NativeDoc.getTag(tags, "@j2sAlias")) == null) |
6237 | 6245 | continue; |
6238 | 6246 | List<?> fragments = tag.fragments(); |
6239 | | - return (fragments == null || fragments.size() == 0 ? null : fragments.get(0).toString().trim()); |
| 6247 | + return (fragments == null ? null : fragments.size() == 0 ? "" : fragments.get(0).toString().trim()); |
6240 | 6248 | } |
6241 | 6249 | return null; |
6242 | 6250 | } |
|
0 commit comments