From 19f070840c830bdab30aff9fb77daa46cc78c5f8 Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Mon, 14 Feb 2022 23:04:20 -0800 Subject: [PATCH] Fixed invalid JSBody annotation in IDBObjectStore, fixed IDBFactory compatibility check (#582) * Fixed invalid JSBody annotation in IDBObjectStore * Fixed backwards IndexedDB support check, it was throwing an exception only if IndexedDB IS SUPPORTED --- .../src/main/java/org/teavm/jso/indexeddb/IDBFactory.java | 2 +- .../src/main/java/org/teavm/jso/indexeddb/IDBObjectStore.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBFactory.java b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBFactory.java index d02056fbc..4af07a6c3 100644 --- a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBFactory.java +++ b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBFactory.java @@ -28,7 +28,7 @@ public abstract class IDBFactory implements JSObject { public static IDBFactory getInstance() { IDBFactory factory = getInstanceImpl(); - if (!factory.isUndefined()) { + if (factory.isUndefined()) { throw new IllegalStateException("IndexedDB is not supported in this browser"); } return factory; diff --git a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStore.java b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStore.java index 167189b34..a955680b9 100644 --- a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStore.java +++ b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStore.java @@ -36,8 +36,8 @@ public abstract class IDBObjectStore implements JSObject, IDBCursorSource { } } - @JSBody(script = "return this;") - private native String[] unwrapStringArray(JSObject obj); + @JSBody(params = "obj", script = "return obj;") + private static native String[] unwrapStringArray(JSObject obj); @JSProperty public abstract String[] getIndexNames();