Update JSO apis

This commit is contained in:
Alexey Andreev 2017-01-23 23:27:57 +03:00
parent c1cddc5a71
commit 5c936878a7
50 changed files with 74 additions and 273 deletions

View File

@ -222,7 +222,7 @@ public class TDouble extends TNumber implements TComparable<TDouble> {
@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);")

View File

@ -101,7 +101,7 @@ public class TFloat extends TNumber implements TComparable<TFloat> {
@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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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<HTMLIFrameElement> {
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);")

View File

@ -19,11 +19,6 @@ import org.teavm.jso.JSBody;
import org.teavm.jso.JSIndexer;
import org.teavm.jso.JSObject;
/**
*
* @author Alexey Andreev
* @param <T>
*/
public abstract class JSArray<T extends JSObject> implements JSArrayReader<T> {
private JSArray() {
}
@ -83,7 +78,7 @@ public abstract class JSArray<T extends JSObject> implements JSArrayReader<T> {
public abstract JSArray<T> 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 <T extends JSObject> JSArray<T> create();
@JSBody(params = "size", script = "return new Array(size);")

View File

@ -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);")

View File

@ -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);
}

View File

@ -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() {
}

View File

@ -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);

View File

@ -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() {
}

View File

@ -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);
}

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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) {

View File

@ -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);")

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<MediaEvent> 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();
}

View File

@ -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<MediaEvent> 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();
}

View File

@ -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);
}

View File

@ -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

View File

@ -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);
}

View File

@ -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<MediaEvent> 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);
}

View File

@ -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);
}

View File

@ -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<MediaEvent> 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);
}

View File

@ -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<MediaEvent> getOnMessage();
@JSMethod
void postMessage(JSObject message, JSObject[] transfer);
@JSMethod
void postMessage(JSObject message, JSObject transfer);
@JSMethod
void postMessage(JSObject message);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<OfflineAudioCompletionEvent> getOnComplete();
@JSMethod
public abstract AudioBuffer startRendering();
@JSMethod
@Override
public abstract void resume();
@JSMethod
public abstract void suspend(double suspendTime);
}

View File

@ -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<MediaEvent> getOnEnded();
@JSMethod
void start(double when);
@JSMethod
void start();
@JSMethod
void stop(double when);
@JSMethod
void stop();
@JSMethod
void setPeriodicWave(PeriodicWave periodicWave);
}

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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<JSNumber> 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);

View File

@ -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> 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 <T> PlatformQueue<T> createQueue();
public static PlatformString stringFromCharCode(int charCode) {

View File

@ -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;