From 7fd414c84ed86c8784bbeb7c70eb28fe6b4b27a1 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 8 Nov 2015 23:52:40 +0300 Subject: [PATCH] Minor bugfixes --- .../main/java/org/teavm/dependency/DependencyChecker.java | 7 ++++--- core/src/main/java/org/teavm/javascript/Renderer.java | 4 +++- jso/apis/src/main/java/org/teavm/jso/browser/Location.java | 1 + .../src/main/java/org/teavm/jso/dom/html/HTMLElement.java | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/teavm/dependency/DependencyChecker.java b/core/src/main/java/org/teavm/dependency/DependencyChecker.java index 3934fd008..dfd1235f4 100644 --- a/core/src/main/java/org/teavm/dependency/DependencyChecker.java +++ b/core/src/main/java/org/teavm/dependency/DependencyChecker.java @@ -312,9 +312,6 @@ public class DependencyChecker implements DependencyInfo { private Set methodsAddedByRoot = new HashSet<>(); public MethodDependency linkMethod(MethodReference methodRef, CallLocation callLocation) { - if (completing && getMethod(methodRef) == null) { - throw new IllegalStateException("Can't submit class during completion phase"); - } if (methodRef == null) { throw new IllegalArgumentException(); } @@ -322,6 +319,10 @@ public class DependencyChecker implements DependencyInfo { if (methodReader != null) { methodRef = methodReader.getReference(); } + + if (completing && getMethod(methodRef) == null) { + throw new IllegalStateException("Can't submit class during completion phase"); + } callGraph.getNode(methodRef); boolean added = true; if (callLocation != null && callLocation.getMethod() != null) { diff --git a/core/src/main/java/org/teavm/javascript/Renderer.java b/core/src/main/java/org/teavm/javascript/Renderer.java index 068486bf9..aeb7c28cd 100644 --- a/core/src/main/java/org/teavm/javascript/Renderer.java +++ b/core/src/main/java/org/teavm/javascript/Renderer.java @@ -196,7 +196,9 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext @Override public Properties getProperties() { - return new Properties(properties); + Properties properties = new Properties(); + properties.putAll(this.properties); + return properties; } public DebugInformationEmitter getDebugEmitter() { diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Location.java b/jso/apis/src/main/java/org/teavm/jso/browser/Location.java index 0aa4e17f9..9b6287ee0 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Location.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Location.java @@ -68,6 +68,7 @@ public interface Location extends JSObject { @JSProperty String getHash(); + @JSProperty void setHash(String hash); void assign(String url); diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java index cbaa58458..54e5674e9 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java @@ -34,7 +34,6 @@ import org.teavm.jso.dom.xml.NodeList; public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget, FocusEventTarget, MouseEventTarget, KeyboardEventTarget, LoadEventTarget { @Override - @JSProperty NodeList getElementsByTagName(String name); @JSProperty