mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fix native declarations
This commit is contained in:
parent
ae68bc366b
commit
3c83c7e7b9
|
@ -21,6 +21,6 @@ public final class Navigator {
|
|||
private Navigator() {
|
||||
}
|
||||
|
||||
@JSBody(script = "return (window || self).navigator.onLine;")
|
||||
@JSBody(script = "return navigator.onLine;")
|
||||
public static native boolean isOnline();
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ public final class Performance implements JSObject {
|
|||
private Performance() {
|
||||
}
|
||||
|
||||
@JSBody(script = "return (window || self).performance.now();")
|
||||
@JSBody(script = "return performance.now();")
|
||||
public static native double now();
|
||||
|
||||
@JSBody(script = "return typeof((window || self).performance) !== 'undefined';")
|
||||
@JSBody(script = "return typeof(performance) !== 'undefined';")
|
||||
public static native boolean isSupported();
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import org.teavm.jso.dom.html.HTMLElement;
|
|||
import org.teavm.jso.dom.html.HTMLIFrameElement;
|
||||
|
||||
public abstract class Window implements JSObject, WindowEventTarget, StorageProvider, JSArrayReader<HTMLIFrameElement> {
|
||||
private static Window cachedInstance;
|
||||
|
||||
private Window() {
|
||||
}
|
||||
|
||||
|
@ -159,9 +161,12 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv
|
|||
postMessage(message, targetOrigin, JSArray.of(transfer));
|
||||
}
|
||||
|
||||
@JSBody(script = "return window || self;")
|
||||
@JSBody(script = "return window;")
|
||||
public static native Window current();
|
||||
|
||||
@JSBody(script = "return self;")
|
||||
public static native Window worker();
|
||||
|
||||
@JSBody(params = "uri", script = "return encodeURI(uri);")
|
||||
public static native String encodeURI(String uri);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user