WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.04k stars 165 forks source link

Use of deprecated `DomException` types. #2551

Closed KristofferStrube closed 11 months ago

KristofferStrube commented 11 months ago

Describe the issue

The specs sepcifies that the connect method MUST throw a InvalidAccessError DOMException if the destinationNode parameter is from another AudioContext. This error is deprecated and we should instead use NotSupportedError.

This is the same case for the output parameter where the specs specify that the connect method MUST throw a IndexSizeError (which is also deprecated) if the index is outside the valid range of indices. Instead of this, we should use the ECMA Script RangeError.

Where Is It

This is one of the places that this is mentioned in the specs: https://webaudio.github.io/web-audio-api/#dom-audionode-connect-destinationparam-output

But there are many more places that it is used in the specs.

Additional Information

I'm not sure if this is something we actually want to change since many might depend on these deprecated errors being emitted.

padenot commented 11 months ago

Thanks for the issue. As you note, it's not worth it to change this. Those errors are deprecated but (and I quote the spec):

are kept for legacy purposes

This is the case we are in here. This part of the Web Audio API standard dates from 2011 or so, it's fairly old.