diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TDouble.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TDouble.java index d7ea47e69..0af2d7b82 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TDouble.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TDouble.java @@ -222,7 +222,7 @@ public class TDouble extends TNumber implements TComparable { @JSBody(params = "v", script = "return isNaN(v);") public static native boolean isNaN(double v); - @JSBody(params = {}, script = "return NaN;") + @JSBody(script = "return NaN;") private static native double getNaN(); @JSBody(params = "v", script = "return !isFinite(v);") diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TFloat.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TFloat.java index fdbd77f58..219407578 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TFloat.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TFloat.java @@ -101,7 +101,7 @@ public class TFloat extends TNumber implements TComparable { @Import(module = "runtime", name = "isFinite") private static native boolean isFinite(float v); - @JSBody(params = {}, script = "return NaN;") + @JSBody(script = "return NaN;") @Import(module = "runtime", name = "getNaN") private static native float getNaN(); diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TRandom.java b/classlib/src/main/java/org/teavm/classlib/java/util/TRandom.java index 0c1c56742..411f76944 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TRandom.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TRandom.java @@ -68,6 +68,6 @@ public class TRandom extends TObject implements TSerializable { return random(); } - @JSBody(params = {}, script = "return Math.random();") + @JSBody(script = "return Math.random();") private static native double random(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/ajax/XMLHttpRequest.java b/jso/apis/src/main/java/org/teavm/jso/ajax/XMLHttpRequest.java index b18b81caa..fceb39d5f 100644 --- a/jso/apis/src/main/java/org/teavm/jso/ajax/XMLHttpRequest.java +++ b/jso/apis/src/main/java/org/teavm/jso/ajax/XMLHttpRequest.java @@ -90,6 +90,6 @@ public abstract class XMLHttpRequest implements JSObject { @JSProperty public abstract String getResponseType(); - @JSBody(params = {}, script = "return new XMLHttpRequest();") + @JSBody(script = "return new XMLHttpRequest();") public static native XMLHttpRequest create(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java b/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java index 5bc5eb91e..0d5a381f9 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Navigator.java @@ -17,14 +17,10 @@ package org.teavm.jso.browser; import org.teavm.jso.JSBody; -/** - * - * @author Alexey Andreev - */ public final class Navigator { private Navigator() { } - @JSBody(params = "", script = "return window.navigator.onLine;") + @JSBody(script = "return window.navigator.onLine;") public static native boolean isOnline(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Performance.java b/jso/apis/src/main/java/org/teavm/jso/browser/Performance.java index 0e503b69d..fd98beb09 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Performance.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Performance.java @@ -22,9 +22,9 @@ public final class Performance implements JSObject { private Performance() { } - @JSBody(params = {}, script = "return window.performance.now();") + @JSBody(script = "return window.performance.now();") public static native double now(); - @JSBody(params = {}, script = "return typeof(window.performance) !== 'undefined';") + @JSBody(script = "return typeof(window.performance) !== 'undefined';") public static native boolean isSupported(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/browser/Window.java b/jso/apis/src/main/java/org/teavm/jso/browser/Window.java index b5ec08652..2dd75b739 100644 --- a/jso/apis/src/main/java/org/teavm/jso/browser/Window.java +++ b/jso/apis/src/main/java/org/teavm/jso/browser/Window.java @@ -24,10 +24,6 @@ import org.teavm.jso.dom.html.HTMLDocument; import org.teavm.jso.dom.html.HTMLElement; import org.teavm.jso.dom.html.HTMLIFrameElement; -/** - * - * @author Alexey Andreev - */ public abstract class Window implements JSObject, WindowEventTarget, StorageProvider, JSArrayReader { private Window() { } @@ -161,7 +157,7 @@ public abstract class Window implements JSObject, WindowEventTarget, StorageProv postMessage(message, targetOrigin, JSArray.of(transfer)); } - @JSBody(params = {}, script = "return window;") + @JSBody(script = "return window;") public static native Window current(); @JSBody(params = "uri", script = "return encodeURI(uri);") diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSArray.java b/jso/apis/src/main/java/org/teavm/jso/core/JSArray.java index 261105093..495a02dea 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSArray.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSArray.java @@ -19,11 +19,6 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; import org.teavm.jso.JSObject; -/** - * - * @author Alexey Andreev - * @param - */ public abstract class JSArray implements JSArrayReader { private JSArray() { } @@ -83,7 +78,7 @@ public abstract class JSArray implements JSArrayReader { public abstract JSArray splice(int start, int count, T a, T b, T c, T d); - @JSBody(params = {}, script = "return new Array();") + @JSBody(script = "return new Array();") public static native JSArray create(); @JSBody(params = "size", script = "return new Array(size);") diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSDate.java b/jso/apis/src/main/java/org/teavm/jso/core/JSDate.java index 039f495ec..e9afd6fb4 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSDate.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSDate.java @@ -19,12 +19,8 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; -/** - * - * @author Alexey Andreev - */ public abstract class JSDate implements JSObject { - @JSBody(params = {}, script = "return new Date();") + @JSBody(script = "return new Date();") public static native JSDate create(); @JSBody(params = "millis", script = "return new Date(millis);") diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSFunction.java b/jso/apis/src/main/java/org/teavm/jso/core/JSFunction.java index 00b7f1cda..9a5df7a23 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSFunction.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSFunction.java @@ -15,13 +15,10 @@ */ package org.teavm.jso.core; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; -/** - * - * @author Alexey Andreev - */ public interface JSFunction extends JSObject { @JSProperty int getLength(); @@ -50,5 +47,5 @@ public interface JSFunction extends JSObject { JSObject call(JSObject thisArg, JSObject a, JSObject b, JSObject c, JSObject d, JSObject e, JSObject f, JSObject g, JSObject h); - JSObject apply(JSObject thisArg, JSObject[] arguments); + JSObject apply(JSObject thisArg, @JSByRef JSObject[] arguments); } diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSNumber.java b/jso/apis/src/main/java/org/teavm/jso/core/JSNumber.java index faeee26d6..52257a8e6 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSNumber.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSNumber.java @@ -18,10 +18,6 @@ package org.teavm.jso.core; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; -/** - * - * @author Alexey Andreev - */ public abstract class JSNumber implements JSObject { private JSNumber() { } diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSRegExp.java b/jso/apis/src/main/java/org/teavm/jso/core/JSRegExp.java index d30a7a88a..d60dd4da0 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSRegExp.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSRegExp.java @@ -19,10 +19,6 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; -/** - * - * @author Alexey Andreev - */ public abstract class JSRegExp implements JSObject { @JSBody(params = "pattern", script = "return new RegExp(pattern);") public static native JSRegExp create(String pattern); diff --git a/jso/apis/src/main/java/org/teavm/jso/core/JSString.java b/jso/apis/src/main/java/org/teavm/jso/core/JSString.java index bca4ee593..9c7752064 100644 --- a/jso/apis/src/main/java/org/teavm/jso/core/JSString.java +++ b/jso/apis/src/main/java/org/teavm/jso/core/JSString.java @@ -19,10 +19,6 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; -/** - * - * @author Alexey Andreev - */ public abstract class JSString implements JSObject { private JSString() { } diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLCanvasElement.java b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLCanvasElement.java index afb94da23..a4f51aeae 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLCanvasElement.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLCanvasElement.java @@ -15,15 +15,10 @@ */ package org.teavm.jso.dom.html; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.canvas.CanvasImageSource; -/** - * - * @author Alexey Andreev - */ public interface HTMLCanvasElement extends HTMLElement, CanvasImageSource { @JSProperty int getWidth(); @@ -41,6 +36,5 @@ public interface HTMLCanvasElement extends HTMLElement, CanvasImageSource { JSObject getContext(String contextId, JSObject attributes); - @JSMethod String toDataURL(String type); } 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 5bf01b9f3..d02056fbc 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 @@ -18,16 +18,12 @@ package org.teavm.jso.indexeddb; import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; -/** - * - * @author Alexey Andreev - */ public abstract class IDBFactory implements JSObject { public static boolean isSupported() { return !getInstanceImpl().isUndefined(); } - @JSBody(params = {}, script = "return typeof this === 'undefined';") + @JSBody(script = "return typeof this === 'undefined';") private native boolean isUndefined(); public static IDBFactory getInstance() { @@ -38,7 +34,7 @@ public abstract class IDBFactory implements JSObject { return factory; } - @JSBody(params = {}, script = "return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || " + @JSBody(script = "return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || " + "window.msIndexedDB;") static native IDBFactory getInstanceImpl(); diff --git a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBIndex.java b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBIndex.java index d777abd39..329886b86 100644 --- a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBIndex.java +++ b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBIndex.java @@ -40,7 +40,7 @@ public abstract class IDBIndex implements JSObject, IDBCursorSource { } } - @JSBody(params = {}, script = "return this;") + @JSBody(script = "return this;") private native String[] unwrapStringArray(JSObject obj); @JSProperty diff --git a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBKeyRange.java b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBKeyRange.java index 9c94bc043..1b6742378 100644 --- a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBKeyRange.java +++ b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBKeyRange.java @@ -19,10 +19,6 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; -/** - * - * @author Alexey Andreev - */ public abstract class IDBKeyRange implements JSObject { @JSProperty public abstract JSObject getLower(); 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 982df66cc..167189b34 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 @@ -20,10 +20,6 @@ import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.core.JSString; -/** - * - * @author Alexey Andreev - */ public abstract class IDBObjectStore implements JSObject, IDBCursorSource { @JSProperty public abstract String getName(); @@ -40,7 +36,7 @@ public abstract class IDBObjectStore implements JSObject, IDBCursorSource { } } - @JSBody(params = {}, script = "return this;") + @JSBody(script = "return this;") private native String[] unwrapStringArray(JSObject obj); @JSProperty diff --git a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStoreParameters.java b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStoreParameters.java index fe6fc42eb..07714997d 100644 --- a/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStoreParameters.java +++ b/jso/apis/src/main/java/org/teavm/jso/indexeddb/IDBObjectStoreParameters.java @@ -19,12 +19,8 @@ import org.teavm.jso.JSBody; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; -/** - * - * @author Alexey Andreev - */ public abstract class IDBObjectStoreParameters implements JSObject { - @JSBody(params = {}, script = "return {};") + @JSBody(script = "return {};") public static native IDBObjectStoreParameters create(); public final IDBObjectStoreParameters keyPath(String... keys) { diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java index b2d6cbdbd..a87524b92 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java @@ -16,91 +16,62 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; -import org.teavm.jso.JSMethod; public abstract class DataView extends ArrayBufferView { - @JSMethod public abstract byte getInt8(int byteOffset); - @JSMethod public abstract short getUInt8(int byteOffset); - @JSMethod public abstract short getInt16(int byteOffset); - @JSMethod public abstract short getInt16(int byteOffset, boolean littleEndian); - @JSMethod public abstract int getUInt16(int byteOffset); - @JSMethod public abstract int getUInt16(int byteOffset, boolean littleEndian); - @JSMethod public abstract int getInt32(int byteOffset); - @JSMethod public abstract int getInt32(int byteOffset, boolean littleEndian); - @JSMethod public abstract int getUInt32(int byteOffset); - @JSMethod public abstract int getUInt32(int byteOffset, boolean littleEndian); - @JSMethod public abstract float getFloat32(int byteOffset); - @JSMethod public abstract float getFloat32(int byteOffset, boolean littleEndian); - @JSMethod public abstract double getFloat64(int byteOffset); - @JSMethod public abstract double getFloat64(int byteOffset, boolean littleEndian); - @JSMethod public abstract void setInt8(int byteOffset, int value); - @JSMethod public abstract void setUInt8(int byteOffset, int value); - @JSMethod public abstract void setInt16(int byteOffset, int value); - @JSMethod public abstract void setInt16(int byteOffset, int value, boolean littleEndian); - @JSMethod public abstract void setUInt16(int byteOffset, int value); - @JSMethod public abstract void setUInt16(int byteOffset, int value, boolean littleEndian); - @JSMethod public abstract void setInt32(int byteOffset, int value); - @JSMethod public abstract void setInt32(int byteOffset, int value, boolean littleEndian); - @JSMethod public abstract void setUInt32(int byteOffset, int value); - @JSMethod public abstract void setUInt32(int byteOffset, int value, boolean littleEndian); - @JSMethod public abstract void setFloat32(int byteOffset, float value); - @JSMethod public abstract void setFloat32(int byteOffset, float value, boolean littleEndian); - @JSMethod public abstract void setFloat64(int byteOffset, double value); - @JSMethod public abstract void setFloat64(int byteOffset, double value, boolean littleEndian); @JSBody(params = "buffer", script = "return new DataView(buffer);") diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float32Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float32Array.java index 6199ebe8d..bd8ab94e1 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float32Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float32Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Float32Array extends ArrayBufferView { @JSIndexer public abstract float get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float64Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float64Array.java index 833ed1f80..9d55f32ab 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float64Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Float64Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Float64Array extends ArrayBufferView { @JSIndexer public abstract double get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int16Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int16Array.java index 8a8d88c0f..03c9e134c 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int16Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int16Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Int16Array extends ArrayBufferView { @JSIndexer public abstract short get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int32Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int32Array.java index bf6f53e0a..8b98f03d8 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int32Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int32Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Int32Array extends ArrayBufferView { @JSIndexer public abstract int get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int8Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int8Array.java index 363acac0d..dae9f06fe 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int8Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Int8Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Int8Array extends ArrayBufferView { @JSIndexer public abstract byte get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint16Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint16Array.java index 751c86359..9680b83cc 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint16Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint16Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Uint16Array extends ArrayBufferView { @JSIndexer public abstract int get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8Array.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8Array.java index efdb0658d..89d851ab7 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8Array.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8Array.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Uint8Array extends ArrayBufferView { @JSIndexer public abstract short get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8ClampedArray.java b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8ClampedArray.java index 26aac42a5..ab072d0db 100644 --- a/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8ClampedArray.java +++ b/jso/apis/src/main/java/org/teavm/jso/typedarrays/Uint8ClampedArray.java @@ -18,10 +18,6 @@ package org.teavm.jso.typedarrays; import org.teavm.jso.JSBody; import org.teavm.jso.JSIndexer; -/** - * - * @author Alexey Andreev - */ public abstract class Uint8ClampedArray extends ArrayBufferView { @JSIndexer public abstract short get(int index); diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AnalyserNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AnalyserNode.java index d4be152f5..712fd9a80 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AnalyserNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AnalyserNode.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSProperty; import org.teavm.jso.typedarrays.Float32Array; import org.teavm.jso.typedarrays.Uint8Array; @@ -48,16 +48,16 @@ public interface AnalyserNode extends AudioNode { @JSProperty float getSmoothingTimeConstant(); - @JSMethod void getFloatFrequencyData(Float32Array array); - @JSMethod + void getFloatFrequencyData(@JSByRef float[] array); + void getByteFrequencyData(Uint8Array array); - @JSMethod void getFloatTimeDomainData(Float32Array array); - @JSMethod + void getFloatTimeDomainData(@JSByRef float[] array); + void getByteTimeDomainData(Uint8Array array); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBuffer.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBuffer.java index 5ec06b463..00a69a12a 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBuffer.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBuffer.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.typedarrays.Float32Array; @@ -33,18 +33,21 @@ public interface AudioBuffer extends JSObject { @JSProperty int getNumberOfChannels(); - @JSMethod Float32Array getChannelData(int channel); - @JSMethod void copyFromChannel(Float32Array destination, int channelNumber); - @JSMethod + void copyFromChannel(@JSByRef float[] destination, int channelNumber); + void copyFromChannel(Float32Array destination, int channelNumber, int startInChannel); - @JSMethod + void copyFromChannel(@JSByRef float[] destination, int channelNumber, int startInChannel); + void copyToChannel(Float32Array source, int channelNumber); - @JSMethod + void copyToChannel(@JSByRef float[] source, int channelNumber); + void copyToChannel(Float32Array source, int channelNumber, int startInChannel); + + void copyToChannel(@JSByRef float[] source, int channelNumber, int startInChannel); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBufferSourceNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBufferSourceNode.java index 738e88fc7..2ef914e7d 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBufferSourceNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioBufferSourceNode.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -56,22 +55,16 @@ public interface AudioBufferSourceNode extends AudioNode { @JSProperty("onended") EventListener getOnEnded(); - @JSMethod void start(double when, double offset, double duration); - @JSMethod void start(double when, double offset); - @JSMethod void start(double when); - @JSMethod void start(); - @JSMethod void stop(double when); - @JSMethod void stop(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java index 9b1a32eb7..50718756b 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java @@ -16,7 +16,7 @@ package org.teavm.jso.webaudio; import org.teavm.jso.JSBody; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -50,112 +50,82 @@ public abstract class AudioContext implements JSObject { @JSProperty("onstatechange") public abstract EventListener getOnStateChange(); - @JSMethod public abstract void suspend(); - @JSMethod public abstract void resume(); - @JSMethod public abstract void close(); - @JSMethod public abstract AudioBuffer createBuffer(int numberOfChannels, int length, float sampleRate); - @JSMethod public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData, DecodeSuccessCallback successCallback, DecodeErrorCallback errorCallback); - @JSMethod public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData, DecodeSuccessCallback successCallback); - @JSMethod public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData); - @JSMethod public abstract AudioBufferSourceNode createBufferSource(); - @JSMethod public abstract MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); - @JSMethod public abstract MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); - @JSMethod public abstract MediaStreamAudioDestinationNode createMediaStreamDestination(); - @JSMethod public abstract AudioWorker createAudioWorker(); - @JSMethod public abstract ScriptProcessorNode createScriptProcessor(int bufferSize, int numberOfInputChannels, int numberOfOutputChannels); - @JSMethod public abstract ScriptProcessorNode createScriptProcessor(int bufferSize, int numberOfInputChannels); - @JSMethod public abstract ScriptProcessorNode createScriptProcessor(int bufferSize); - @JSMethod public abstract ScriptProcessorNode createScriptProcessor(); - @JSMethod public abstract AnalyserNode createAnalyser(); - @JSMethod public abstract GainNode createGain(); - @JSMethod public abstract DelayNode createDelay(double maxDelayTime); - @JSMethod public abstract DelayNode createDelay(); - @JSMethod public abstract BiquadFilterNode createBiquadFilter(); - @JSMethod public abstract IIRFilterNode createIIRFilter(Float32Array feedforward, Float32Array feedback); - @JSMethod public abstract WaveShaperNode createWaveShaper(); - @JSMethod public abstract PannerNode createPanner(); - @JSMethod public abstract StereoPannerNode createStereoPanner(); - @JSMethod public abstract ConvolverNode createConvolver(); - @JSMethod public abstract ChannelSplitterNode createChannelSplitter(int numberOfOutputs); - @JSMethod public abstract ChannelSplitterNode createChannelSplitter(); - @JSMethod public abstract ChannelMergerNode createChannelMerger(int numberOfInputs); - @JSMethod public abstract ChannelMergerNode createChannelMerger(); - @JSMethod public abstract DynamicsCompressorNode createDynamicsCompressor(); - @JSMethod public abstract OscillatorNode createOscillator(); - @JSMethod public abstract PeriodicWave createPeriodicWave(Float32Array real, Float32Array image, PeriodicWaveConstraints constraints); - @JSMethod + public abstract PeriodicWave createPeriodicWave(@JSByRef float[] real, @JSByRef float[] image, + PeriodicWaveConstraints constraints); + public abstract PeriodicWave createPeriodicWave(Float32Array real, Float32Array image); - @JSBody(params = {}, - script = "var Context = window.AudioContext || window.webkitAudioContext; return new Context();") + public abstract PeriodicWave createPeriodicWave(@JSByRef float[] real, @JSByRef float[] image); + + @JSBody(script = "var Context = window.AudioContext || window.webkitAudioContext; return new Context();") public static native AudioContext create(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioListener.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioListener.java index 681fc4b03..73f08c864 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioListener.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioListener.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; @@ -32,13 +31,10 @@ public interface AudioListener extends JSObject { @JSProperty float getSpeedOfSound(); - @JSMethod void setPosition(float x, float y, float z); - @JSMethod void setOrientation(float x, float y, float z, float xUp, float yUp, float zUp); - @JSMethod void setVelocity(float x, float y, float z); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java index 1aa9e48fc..b7ed28ff7 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; @@ -27,40 +26,28 @@ public interface AudioNode extends JSObject { String CHANNEL_INTERPRETATION_SPEAKERS = "speakers"; String CHANNEL_INTERPRETATION_DISCRETE = "discrete"; - @JSMethod void connect(AudioNode destination, int output, int input); - @JSMethod void connect(AudioNode destination, int output); - @JSMethod void connect(AudioNode destination); - @JSMethod void connect(AudioParam destination, int output); - @JSMethod void connect(AudioParam destination); - @JSMethod void disconnect(); - @JSMethod void disconnect(int output); - @JSMethod void disconnect(AudioNode destination); - @JSMethod void disconnect(AudioNode destination, int output); - @JSMethod void disconnect(AudioNode destination, int output, int input); - @JSMethod void disconnect(AudioParam destination); - @JSMethod void disconnect(AudioParam destination, int output); @JSProperty diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioParam.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioParam.java index 439d1ccd5..30f0786e0 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioParam.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioParam.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.typedarrays.Float32Array; @@ -30,21 +30,17 @@ public interface AudioParam extends JSObject { @JSProperty float getDefaultValue(); - @JSMethod void setValueAtTime(float value, double startTime); - @JSMethod void linearRampToValueAtTime(float value, double endTime); - @JSMethod void exponentialRampToValueAtTime(float value, double endTime); - @JSMethod void setTargetAtTime(float target, double startTime, float timeConstant); - @JSMethod void setValueCurveAtTime(Float32Array values, double startTime, double duration); - @JSMethod + void setValueCurveAtTime(@JSByRef float[] values, double startTime, double duration); + void cancelScheduledValues(double startTime); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorker.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorker.java index 9870042a1..d0c56b83c 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorker.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorker.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -36,24 +36,17 @@ public interface AudioWorker extends JSObject { @JSProperty(value = "onloaded") EventListener getOnLoaded(); - @JSMethod void terminate(); - @JSMethod - void postMessage(JSObject message, JSObject[] transfer); + void postMessage(JSObject message, @JSByRef JSObject[] transfer); - @JSMethod void postMessage(JSObject message, JSObject transfer); - @JSMethod void postMessage(JSObject message); - @JSMethod AudioWorkerNode createNode(int numberOfInputs, int numberOfOutputs); - @JSMethod AudioParam addParameter(String name, float defaultValue); - @JSMethod void removeParameter(String name); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerGlobalScope.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerGlobalScope.java index 09d669517..bf1dc1478 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerGlobalScope.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerGlobalScope.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -39,9 +38,7 @@ public interface AudioWorkerGlobalScope extends JSObject { @JSProperty AudioWorkerParamDescriptor[] getParameters(); - @JSMethod AudioParam addParameter(String name, float defaultValue); - @JSMethod void removeParameter(String name); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNode.java index 0362ab5d3..171321274 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNode.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -27,13 +27,10 @@ public interface AudioWorkerNode extends AudioNode { @JSProperty("onmessage") EventListener getOnMessage(); - @JSMethod - void postMessage(JSObject message, JSObject[] transfer); + void postMessage(JSObject message, @JSByRef JSObject[] transfer); - @JSMethod void postMessage(JSObject message, JSObject transfer); - @JSMethod void postMessage(JSObject message); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNodeProcessor.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNodeProcessor.java index f7ba0880a..b06935ca7 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNodeProcessor.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/AudioWorkerNodeProcessor.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -28,13 +27,10 @@ public interface AudioWorkerNodeProcessor extends EventTarget { @JSProperty("onmessage") EventListener getOnMessage(); - @JSMethod void postMessage(JSObject message, JSObject[] transfer); - @JSMethod void postMessage(JSObject message, JSObject transfer); - @JSMethod void postMessage(JSObject message); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/BiquadFilterNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/BiquadFilterNode.java index 2c3aacb6d..2abfdfd2c 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/BiquadFilterNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/BiquadFilterNode.java @@ -15,7 +15,7 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSProperty; import org.teavm.jso.typedarrays.Float32Array; @@ -47,6 +47,8 @@ public interface BiquadFilterNode extends AudioNode { @JSProperty AudioParam getGain(); - @JSMethod void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); + + void getFrequencyResponse(@JSByRef float[] frequencyHz, @JSByRef float[] magResponse, + @JSByRef float[] phaseResponse); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeErrorCallback.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeErrorCallback.java index 6ba606ecb..ad8296de6 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeErrorCallback.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeErrorCallback.java @@ -16,11 +16,9 @@ package org.teavm.jso.webaudio; import org.teavm.jso.JSFunctor; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; @JSFunctor public interface DecodeErrorCallback extends JSObject { - @JSMethod void onError(JSObject error); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeSuccessCallback.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeSuccessCallback.java index 9db57057b..a598e5a74 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeSuccessCallback.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/DecodeSuccessCallback.java @@ -16,11 +16,9 @@ package org.teavm.jso.webaudio; import org.teavm.jso.JSFunctor; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; @JSFunctor public interface DecodeSuccessCallback extends JSObject { - @JSMethod void onSuccess(AudioBuffer decodedData); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/IIRFilterNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/IIRFilterNode.java index eb74c8886..c4086d9d4 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/IIRFilterNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/IIRFilterNode.java @@ -15,11 +15,13 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; +import org.teavm.jso.JSByRef; import org.teavm.jso.typedarrays.Float32Array; public interface IIRFilterNode extends AudioNode { - @JSMethod void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse); + + void getFrequencyResponse(@JSByRef float[] frequencyHz, @JSByRef float[] magResponse, + @JSByRef float[] phaseResponse); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/OfflineAudioContext.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/OfflineAudioContext.java index 858c4d68b..f81d634a2 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/OfflineAudioContext.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/OfflineAudioContext.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -26,12 +25,10 @@ public abstract class OfflineAudioContext extends AudioContext { @JSProperty("oncomplete") public abstract EventListener getOnComplete(); - @JSMethod public abstract AudioBuffer startRendering(); - @JSMethod + @Override public abstract void resume(); - @JSMethod public abstract void suspend(double suspendTime); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/OscillatorNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/OscillatorNode.java index c45259946..849a0b8f7 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/OscillatorNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/OscillatorNode.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSProperty; import org.teavm.jso.dom.events.EventListener; @@ -44,18 +43,13 @@ public interface OscillatorNode extends AudioNode { @JSProperty("onended") EventListener getOnEnded(); - @JSMethod void start(double when); - @JSMethod void start(); - @JSMethod void stop(double when); - @JSMethod void stop(); - @JSMethod void setPeriodicWave(PeriodicWave periodicWave); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webaudio/PannerNode.java b/jso/apis/src/main/java/org/teavm/jso/webaudio/PannerNode.java index d61d1f544..8c35fc8b4 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webaudio/PannerNode.java +++ b/jso/apis/src/main/java/org/teavm/jso/webaudio/PannerNode.java @@ -15,7 +15,6 @@ */ package org.teavm.jso.webaudio; -import org.teavm.jso.JSMethod; import org.teavm.jso.JSProperty; public interface PannerNode extends AudioNode { @@ -74,13 +73,10 @@ public interface PannerNode extends AudioNode { @JSProperty float getConeOuterGain(); - @JSMethod void setPosition(float x, float y, float z); - @JSMethod void setOrientation(float x, float y, float z); - @JSMethod void setVelocity(float x, float y, float z); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLContextAttributes.java b/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLContextAttributes.java index f64748a7f..6517f9f67 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLContextAttributes.java +++ b/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLContextAttributes.java @@ -60,6 +60,6 @@ public abstract class WebGLContextAttributes implements JSObject { @JSProperty public abstract void setPreserveDrawingBuffer(boolean preserveDrawingBuffer); - @JSBody(params = {}, script = "return {};") + @JSBody(script = "return {};") public static native WebGLContextAttributes create(); } diff --git a/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLRenderingContext.java b/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLRenderingContext.java index 345aabbea..5fd48da04 100644 --- a/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLRenderingContext.java +++ b/jso/apis/src/main/java/org/teavm/jso/webgl/WebGLRenderingContext.java @@ -15,6 +15,7 @@ */ package org.teavm.jso.webgl; +import org.teavm.jso.JSByRef; import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; @@ -659,7 +660,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform1fv(WebGLUniformLocation location, JSArrayReader v); - void uniform1fv(WebGLUniformLocation location, float[] v); + void uniform1fv(WebGLUniformLocation location, @JSByRef float[] v); void uniform1i(WebGLUniformLocation location, int x); @@ -667,7 +668,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform1iv(WebGLUniformLocation location, JSArrayReader v); - void uniform1iv(WebGLUniformLocation location, int[] v); + void uniform1iv(WebGLUniformLocation location, @JSByRef int[] v); void uniform2f(WebGLUniformLocation location, float x, float y); @@ -675,7 +676,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform2fv(WebGLUniformLocation location, JSArrayReader v); - void uniform2fv(WebGLUniformLocation location, float[] v); + void uniform2fv(WebGLUniformLocation location, @JSByRef float[] v); void uniform2i(WebGLUniformLocation location, int x, int y); @@ -683,7 +684,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform2iv(WebGLUniformLocation location, JSArrayReader v); - void uniform2iv(WebGLUniformLocation location, int[] v); + void uniform2iv(WebGLUniformLocation location, @JSByRef int[] v); void uniform3f(WebGLUniformLocation location, float x, float y, float z); @@ -691,7 +692,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform3fv(WebGLUniformLocation location, JSArrayReader v); - void uniform3fv(WebGLUniformLocation location, float[] v); + void uniform3fv(WebGLUniformLocation location, @JSByRef float[] v); void uniform3i(WebGLUniformLocation location, int x, int y, int z); @@ -699,7 +700,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform3iv(WebGLUniformLocation location, JSArrayReader v); - void uniform3iv(WebGLUniformLocation location, int[] v); + void uniform3iv(WebGLUniformLocation location, @JSByRef int[] v); void uniform4f(WebGLUniformLocation location, float x, float y, float z, float w); @@ -707,7 +708,7 @@ public interface WebGLRenderingContext extends JSObject { void uniform4fv(WebGLUniformLocation location, JSArrayReader v); - void uniform4fv(WebGLUniformLocation location, float[] v); + void uniform4fv(WebGLUniformLocation location, @JSByRef float[] v); void uniform4i(WebGLUniformLocation location, int x, int y, int z, int w); @@ -715,25 +716,25 @@ public interface WebGLRenderingContext extends JSObject { void uniform4iv(WebGLUniformLocation location, JSArrayReader v); - void uniform4iv(WebGLUniformLocation location, int[] v); + void uniform4iv(WebGLUniformLocation location, @JSByRef int[] v); void uniformMatrix2fv(WebGLUniformLocation location, boolean transpose, Float32Array value); void uniformMatrix2fv(WebGLUniformLocation location, boolean transpose, JSArrayReader value); - void uniformMatrix2fv(WebGLUniformLocation location, boolean transpose, float[] value); + void uniformMatrix2fv(WebGLUniformLocation location, boolean transpose, @JSByRef float[] value); void uniformMatrix3fv(WebGLUniformLocation location, boolean transpose, Float32Array value); void uniformMatrix3fv(WebGLUniformLocation location, boolean transpose, JSArrayReader value); - void uniformMatrix3fv(WebGLUniformLocation location, boolean transpose, float[] value); + void uniformMatrix3fv(WebGLUniformLocation location, boolean transpose, @JSByRef float[] value); void uniformMatrix4fv(WebGLUniformLocation location, boolean transpose, Float32Array value); void uniformMatrix4fv(WebGLUniformLocation location, boolean transpose, JSArrayReader value); - void uniformMatrix4fv(WebGLUniformLocation location, boolean transpose, float[] value); + void uniformMatrix4fv(WebGLUniformLocation location, boolean transpose, @JSByRef float[] value); void useProgram(WebGLProgram program); @@ -745,7 +746,7 @@ public interface WebGLRenderingContext extends JSObject { void vertexAttrib1fv(int indx, JSArrayReader values); - void vertexAttrib1fv(int indx, float[] values); + void vertexAttrib1fv(int indx, @JSByRef float[] values); void vertexAttrib2f(int indx, float x, float y); @@ -753,7 +754,7 @@ public interface WebGLRenderingContext extends JSObject { void vertexAttrib2fv(int indx, JSArrayReader values); - void vertexAttrib2fv(int indx, float[] values); + void vertexAttrib2fv(int indx, @JSByRef float[] values); void vertexAttrib3f(int indx, float x, float y, float z); @@ -761,7 +762,7 @@ public interface WebGLRenderingContext extends JSObject { void vertexAttrib3fv(int indx, JSArrayReader values); - void vertexAttrib3fv(int indx, float[] values); + void vertexAttrib3fv(int indx, @JSByRef float[] values); void vertexAttrib4f(int indx, float x, float y, float z, float w); @@ -769,7 +770,7 @@ public interface WebGLRenderingContext extends JSObject { void vertexAttrib4fv(int indx, JSArrayReader values); - void vertexAttrib4fv(int indx, float[] values); + void vertexAttrib4fv(int indx, @JSByRef float[] values); void vertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, int offset); diff --git a/platform/src/main/java/org/teavm/platform/Platform.java b/platform/src/main/java/org/teavm/platform/Platform.java index 60c9d6ada..6f6b02d1e 100644 --- a/platform/src/main/java/org/teavm/platform/Platform.java +++ b/platform/src/main/java/org/teavm/platform/Platform.java @@ -81,7 +81,7 @@ public final class Platform { return (PlatformConsole) Window.current(); } - @JSBody(params = {}, script = "return $rt_nextId();") + @JSBody(script = "return $rt_nextId();") public static native int nextObjectId(); public static T newInstance(PlatformClass cls) { @@ -140,7 +140,7 @@ public final class Platform { ((PlatformHelper) Window.current()).killSchedule(id); } - @JSBody(params = {}, script = "return [];") + @JSBody(script = "return [];") public static native PlatformQueue createQueue(); public static PlatformString stringFromCharCode(int charCode) { diff --git a/tests/src/test/java/org/teavm/vm/VMTest.java b/tests/src/test/java/org/teavm/vm/VMTest.java index c8e2e2e54..30da6759f 100644 --- a/tests/src/test/java/org/teavm/vm/VMTest.java +++ b/tests/src/test/java/org/teavm/vm/VMTest.java @@ -152,7 +152,7 @@ public class VMTest { assertEquals(30, s); } - @JSBody(params = {}, script = "return [1, 2]") + @JSBody(script = "return [1, 2]") private static native int[] createArray(); static int initCount = 0;