gecko-dev/dom/worklet/tests/worklet_promise.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 строки
493 B
JavaScript
Исходник Обычный вид История

class WasmProcessWorkletProcessor extends AudioWorkletProcessor {
constructor(...args) {
super(...args);
this.port.onmessage = e => {
WebAssembly.compile(e.data).then(
m => {
this.port.postMessage(m);
},
() => {
this.port.postMessage("error");
}
);
};
}
process(inputs, outputs, parameters) {
// Do nothing, output silence
return true;
}
}
registerProcessor("promise", WasmProcessWorkletProcessor);