Skip to content

Commit 6c359e8

Browse files
committed
adding nonqualified classes and not adding default constructor when
nonqualified and have "construct" "swingjs.JSAppletViewer", "swingjs.JSFrameViewer", "java.applet.AppletContext", "java.applet.AppletStub",
1 parent c255a82 commit 6c359e8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/ASTKeywordVisitor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,8 @@ public static void setNoQualifiedNamePackages(String names) {
15291529
// these are pre-defined in j2sSwingJSext.js
15301530
"swingjs.JSAppletViewer",
15311531
"swingjs.JSFrameViewer",
1532+
"java.applet.AppletContext",
1533+
"java.applet.AppletStub",
15321534
"java.lang.Boolean",
15331535
"java.lang.Byte",
15341536
"java.lang.Character",

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/ASTScriptVisitor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ public boolean visit(MethodDeclaration node) {
11891189
return false;
11901190
}
11911191
String name = (isConstructor ? "construct" : getJ2SName(node.getName())) + getJ2SParamQualifier(null, mBinding);
1192+
if (name.equals("construct"))
1193+
defaultConstructor = mBinding; // in case we are not qualifying names here
11921194
buffer.append("\r\nClazz.newMethod$(C$, '").append(name).append("', ").append("function (");
11931195
@SuppressWarnings("unchecked")
11941196
List<ASTNode> parameters = node.parameters();

0 commit comments

Comments
 (0)