You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that each particular type describes the steps for the constructor and WebIDL describes the steps for creation from ECMAScript and that the generic algorithm is not complete for all "particular type"s, I guess it would be best to remove the generic algorithm "to create an AudioNode of a particular type n using its constructor".
Also, the algorithm "to create a new AudioNode of a particular type n using its factory method" does not invoke the constructor, and so does not contain any type-specific additional initialization steps, such as those in the MediaStreamAudioSourceNode constructor. Perhaps this should invoke the constructor instead of the "Intialize" algorithm.
The text was updated successfully, but these errors were encountered:
I believe this is an artifact of when we added the node constructors in addition to the factory methods, and we wanted to use a generic algorithm to describe the construction since they are all very similar. And because we didn't want to duplicate much of the algorithm across every single node.
Remove the generic ctor algorithm in favour of one for each type that calls the "initialize" algorithm, and pass the arguments appropriately.
Change the generic factory method algorithm to call the ctor underneath, so that the "initialize" algorithm is called and the specific initialization is performed
The Web Audio API specifies an algorithm to create an AudioNode of a particular type using its constructor.
Many descriptions of constructors more or less repeat that algorithm, but without explicitly passing arguments to the algorithm for Initializing an object that inherits from AudioNode.
e.g. the AudioBufferSourceNode constructor.
Some descriptions of constructors use a similar algorithm, but extended to perform additional initialization (e.g. the MediaStreamAudioSourceNode ).
The AudioWorkletNode constructor description is a little different in that the algorithm initializes
this
instead of creating and returning a new object.The approach for AudioWorkletNode seems more consistent with the WebIDL spec which says that
The prose definition of a constructor operation must either initialize the value passed as
this
, or throw an exception.The WebIDL algorithm for creation of an interface object with the ECMAScript binding will "Perform the actions listed in the description of constructor with values as the argument values and object as this" and so it would not seem appropriate for the description of the constructor to return a new object.
Given that each particular type describes the steps for the constructor and WebIDL describes the steps for creation from ECMAScript and that the generic algorithm is not complete for all "particular type"s, I guess it would be best to remove the generic algorithm "to create an
AudioNode
of a particular type n using its constructor".Also, the algorithm "to create a new
AudioNode
of a particular type n using its factory method" does not invoke the constructor, and so does not contain any type-specific additional initialization steps, such as those in theMediaStreamAudioSourceNode
constructor. Perhaps this should invoke the constructor instead of the "Intialize" algorithm.The text was updated successfully, but these errors were encountered: