Skip to content

Commit b4550fc

Browse files
committed
Update to latest gwt/elemental2 and enable j2cl tests in build
1 parent de1d60c commit b4550fc

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

gwt-core-gwt2-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<maven.licence.plugin>3.0</maven.licence.plugin>
5858
<maven.source.plugin>3.1.0</maven.source.plugin>
5959

60-
<gwt.version>2.8.2</gwt.version>
60+
<gwt.version>2.9.0</gwt.version>
6161
<junit.version>4.12</junit.version>
6262
</properties>
6363

gwt-core-j2cl-tests/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
<vertispan.j2cl.repo.url>https://repo.vertispan.com/j2cl/</vertispan.j2cl.repo.url>
6262
<google.snapshot.repo.url>https://oss.sonatype.org/content/repositories/google-snapshots/</google.snapshot.repo.url>
6363

64-
<!-- <elemental2.version>1.0.0-RC1</elemental2.version>-->
65-
<jsinterop.base.version>1.0.0-SNAPSHOT</jsinterop.base.version>
6664
<j2cl.version>0.7-SNAPSHOT</j2cl.version>
6765
<slf4j.version>1.7.5</slf4j.version>
6866
</properties>
@@ -130,6 +128,7 @@
130128
<executions>
131129
<execution>
132130
<id>j2cl-test</id>
131+
<phase>test</phase>
133132
<goals>
134133
<goal>test</goal>
135134
</goals>

gwt-core-j2cl-tests/src/test/java/org/gwtproject/core/client/ScriptInjectorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,14 @@ private Window topWindow() {
527527
};
528528

529529
private Document getDocumentFromWindow(JavaScriptObject wnd) {
530-
return Js.<JsPropertyMap<Any>>cast(wnd).getAny("document").cast();
530+
return Js.<JsPropertyMap<Any>>cast(wnd).getAsAny("document").cast();
531531
}
532532

533533
/** @return URL of test base path */
534534
private String getTestBasePath() {
535535

536536
// TODO This is more a hack and should be improved!
537-
final String href = DomGlobal.location.getHref();
537+
final String href = DomGlobal.location.href;
538538
final String basePath = href.substring(0, href.lastIndexOf("/") + 1);
539539

540540
return basePath;

gwt-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<maven.source.plugin>3.2.1</maven.source.plugin>
5353
<maven.deploy.plugin>3.0.0-M1</maven.deploy.plugin>
5454

55-
<elemental2.version>1.0.0-RC1</elemental2.version>
55+
<elemental2.version>1.0.0</elemental2.version>
5656
</properties>
5757

5858
<dependencies>

gwt-core/src/main/java/org/gwtproject/core/client/JsArrayMixed.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected JsArrayMixed() {}
4949
*/
5050
@JsOverlay
5151
public final boolean getBoolean(int index) {
52-
return Js.isTruthy(this.<JsArray<Object>>cast().getAnyAt(index));
52+
return Js.isTruthy(this.<JsArray<Object>>cast().getAtAsAny(index));
5353
}
5454

5555
/**
@@ -60,7 +60,7 @@ public final boolean getBoolean(int index) {
6060
*/
6161
@JsOverlay
6262
public final double getNumber(int index) {
63-
return Js.coerceToDouble(this.<JsArray<Object>>cast().getAnyAt(index));
63+
return Js.coerceToDouble(this.<JsArray<Object>>cast().getAtAsAny(index));
6464
}
6565

6666
/**
@@ -72,7 +72,7 @@ public final double getNumber(int index) {
7272
@JsOverlay
7373
public final <T extends JavaScriptObject> T getObject(int index) {
7474
return this.<JsArray<Object>>cast().getAt(index) != null
75-
? this.<JsArray<Object>>cast().getAnyAt(index).cast()
75+
? this.<JsArray<Object>>cast().getAtAsAny(index).<T>cast()
7676
: null;
7777
}
7878

gwt-core/src/main/java/org/gwtproject/core/client/ScriptInjector.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public JavaScriptObject inject() {
5252
assert wnd != null;
5353
Document doc =
5454
Js.<JsPropertyMap<Any>>uncheckedCast(wnd)
55-
.getAny("document")
55+
.getAsAny("document")
5656
.uncheckedCast(); // window has no document property... TODO
5757
assert doc != null;
5858

@@ -116,7 +116,7 @@ public JavaScriptObject inject() {
116116
assert wnd != null;
117117
Document doc =
118118
Js.<JsPropertyMap<Any>>uncheckedCast(wnd)
119-
.getAny("document")
119+
.getAsAny("document")
120120
.uncheckedCast(); // window has no document property... TODO
121121
assert doc != null;
122122

@@ -237,7 +237,6 @@ private static void attachListeners(
237237
if (removeTag) {
238238
scriptElement.parentNode.removeChild(scriptElement);
239239
}
240-
return null;
241240
};
242241
// or possibly more portable script_tag.addEventListener('error', function(){...}, true);
243242
scriptElement.onerror =

0 commit comments

Comments
 (0)