Skip to content

Commit ef6dadf

Browse files
authored
Merge branch 'main' into gson-update-test
2 parents b2160d4 + b9d1d99 commit ef6dadf

File tree

4 files changed

+11
-196
lines changed

4 files changed

+11
-196
lines changed

user/super/com/google/gwt/emul/java/util/InternalHashCodeMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
class InternalHashCodeMap<K, V> implements Iterable<Entry<K, V>> {
3434

35-
private final InternalJsMap<Object> backingMap = InternalJsMapFactory.newJsMap();
35+
private final InternalJsMap<Object> backingMap = new InternalJsMap<>();
3636
private AbstractHashMap<K, V> host;
3737
private int size;
3838

user/super/com/google/gwt/emul/java/util/InternalJsMap.java

+9-26
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import jsinterop.annotations.JsType;
2323

2424
@JsType(isNative = true, name = "Map", namespace = JsPackage.GLOBAL)
25-
interface InternalJsMap<V> {
25+
class InternalJsMap<V> {
2626

2727
@JsType(isNative = true, name = "IteratorIterable", namespace = JsPackage.GLOBAL)
2828
interface Iterator<V> {
@@ -47,31 +47,14 @@ interface IteratorEntry<V> {
4747
default V getValue() { return JsUtils.uncheckedCast(getValueInternal()[1]); }
4848
}
4949

50-
V get(int key);
51-
V get(String key);
52-
void set(int key, V value);
53-
void set(String key, V value);
54-
Iterator<V> entries();
55-
56-
@JsOverlay
57-
default void delete(int key) {
58-
// Calls delete without map.delete in order to be compatible with old browsers where delete is a
59-
// keyword.
60-
DeleteFunction fn = JsUtils.getProperty(this, "delete");
61-
fn.call(this, key);
62-
}
63-
64-
@JsOverlay
65-
default void delete(String key) {
66-
// Calls delete without map.delete in order to be compatible with old browsers where delete is a
67-
// keyword.
68-
DeleteFunction fn = JsUtils.getProperty(this, "delete");
69-
fn.call(this, key);
50+
InternalJsMap() {
7051
}
7152

72-
@JsType(isNative = true, name = "Function", namespace = JsPackage.GLOBAL)
73-
interface DeleteFunction {
74-
void call(InternalJsMap<?> thisArg, String key);
75-
void call(InternalJsMap<?> thisArg, int key);
76-
}
53+
native V get(int key);
54+
native V get(String key);
55+
native void set(int key, V value);
56+
native void set(String key, V value);
57+
native Iterator<V> entries();
58+
native void delete(String key);
59+
native void delete(int key);
7760
}

user/super/com/google/gwt/emul/java/util/InternalJsMapFactory.java

-168
This file was deleted.

user/super/com/google/gwt/emul/java/util/InternalStringMap.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
class InternalStringMap<K, V> implements Iterable<Entry<K, V>> {
2525

26-
private final InternalJsMap<V> backingMap = InternalJsMapFactory.newJsMap();
26+
private final InternalJsMap<V> backingMap = new InternalJsMap<>();
2727
private AbstractHashMap<K, V> host;
2828
private int size;
2929

0 commit comments

Comments
 (0)