Bug 1443228 - Make the ConvolverNode ctor throw NotSupportedError when passed a buffer with an invalid channel count. r?karlt draft
authorPaul Adenot <paul@paul.cx>
Thu, 08 Mar 2018 11:23:45 +0100
changeset 764814 3ffed43879fb6912ca4b1bf47d60b6a1eb8b301f
parent 763109 51200c0fdaddb2749549a82596da5323a4cbd499
push id101856
push userpaul@paul.cx
push dateThu, 08 Mar 2018 10:39:25 +0000
reviewerskarlt
bugs1443228
milestone60.0a1
Bug 1443228 - Make the ConvolverNode ctor throw NotSupportedError when passed a buffer with an invalid channel count. r?karlt Spec: https://webaudio.github.io/web-audio-api/#dom-convolvernode-buffer This is well tested in web-platform-test, the test has been added a day ago and will be merged soon: https://github.com/w3c/web-platform-tests/blob/16376ce7a6ca10ca6ac31dff565c47b6555e3103/webaudio/the-audio-api/the-convolvernode-interface/convolver-channels.html MozReview-Commit-ID: LxsDomV5bEL
dom/media/webaudio/ConvolverNode.cpp
--- a/dom/media/webaudio/ConvolverNode.cpp
+++ b/dom/media/webaudio/ConvolverNode.cpp
@@ -241,17 +241,17 @@ ConvolverNode::SetBuffer(JSContext* aCx,
   if (aBuffer) {
     switch (aBuffer->NumberOfChannels()) {
     case 1:
     case 2:
     case 4:
       // Supported number of channels
       break;
     default:
-      aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
+      aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
       return;
     }
   }
 
   // Send the buffer to the stream
   AudioNodeStream* ns = mStream;
   MOZ_ASSERT(ns, "Why don't we have a stream here?");
   if (aBuffer) {