Closed karlt closed 5 years ago
Blink declares callback BlinkAudioWorkletProcessorConstructor = any (any options);
https://chromium.googlesource.com/chromium/src/+blame/52dded60a7c8b0c66637c35a9450744d99ef1581/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.idl#21
which is the same as Function.
https://heycam.github.io/webidl/#Function
So I guess s/VoidFunction/Function/ is appropriate here.
Oh, I missed the ...
in Function.
Function has multiple arguments, and so I guess it is better to have something similar to the blink webidl to clarify that only one parameter will be used.
I can add callback AudioWorkletProcessorConstructor = any (any options)
in the IDL of AudioWorkletGlobalScope.
AudioWorkletGlobalScope.registerProcessor() is declared in webidl with the processorCtor parameter of type VoidFunction. https://webaudio.github.io/web-audio-api/#audioworkletglobalscope "The VoidFunction callback function type is used for representing function values that take no arguments and do not return any value." https://heycam.github.io/webidl/#VoidFunction
However, "the construction of an AudioWorkletProcessor" requires calling Construct() with a list of options, and so the processorCtor would be called with an argument.
Further, the return value is from the constructor is used in the Construct algorithm, and so I'm not clear how a missing return value would be enforced or ignored. https://tc39.github.io/ecma262/#sec-construct https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new