Fix constructor publishing in JSO

This commit is contained in:
Alexey Andreev 2015-10-11 19:03:15 +03:00
parent 5592862c70
commit f5b21f9455
3 changed files with 7 additions and 1 deletions

View File

@ -23,7 +23,7 @@ import org.teavm.jso.JSProperty;
* @author Alexey Andreev
*/
public abstract class ArrayBufferView implements JSObject {
private ArrayBufferView() {
protected ArrayBufferView() {
}
@JSProperty

View File

@ -211,6 +211,9 @@ class JSClassProcessor {
}
private MethodReader findOverridenMethod(String className, MethodReader finalMethod) {
if (finalMethod.getName().equals("<init>")) {
return null;
}
return classSource.getAncestors(className)
.skip(1)
.map(cls -> cls.getMethod(finalMethod.getDescriptor()))

View File

@ -111,6 +111,9 @@ class JSDependencyListener extends AbstractDependencyListener {
}
addInterfaces(exposedCls, cls);
for (MethodReader method : cls.getMethods()) {
if (method.getName().equals("<init>")) {
continue;
}
if (exposedCls.inheritedMethods.containsKey(method.getDescriptor())
|| exposedCls.methods.containsKey(method.getDescriptor())) {
MethodDependency methodDep = agent.linkMethod(method.getReference(), null);