summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/processors/construction-port-super-after-new.js
blob: e447830c5ffb442842bc1c6c6227dd8531d085e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class SuperAfterNew extends AudioWorkletProcessor {
  constructor() {
    const processor = new AudioWorkletProcessor()
    let message = {threw: false};
    try {
      super();
    } catch (e) {
      message.threw = true;
      message.errorName = e.name;
      message.isTypeError = e instanceof TypeError;
    }
    processor.port.postMessage(message);
    return processor;
  }
}
registerProcessor("super-after-new", SuperAfterNew);