From ea99979765d71e9e1e8523724a206b91023ecfe4 Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Thu, 26 Apr 2018 17:15:53 +0200 Subject: [PATCH] Bug 1457013 - In AudioBuffer return NOT_SUPPORTED error message for various cases to align with the spec. r=padenot MozReview-Commit-ID: LdT7rwSK4D0 --HG-- extra : rebase_source : a7fad8a90f4d3ed21ae8346aecf8f0c690a08285 --- dom/media/webaudio/AudioBuffer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dom/media/webaudio/AudioBuffer.cpp b/dom/media/webaudio/AudioBuffer.cpp index ce1687ae4c1a..ebe40c331ee0 100644 --- a/dom/media/webaudio/AudioBuffer.cpp +++ b/dom/media/webaudio/AudioBuffer.cpp @@ -171,7 +171,7 @@ AudioBuffer::AudioBuffer(nsPIDOMWindowInner* aWindow, aSampleRate > WebAudioUtils::MaxSampleRate || aNumberOfChannels > WebAudioUtils::MaxChannelCount || !aLength || aLength > INT32_MAX) { - aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; } @@ -194,7 +194,7 @@ AudioBuffer::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) { if (!aOptions.mNumberOfChannels) { - aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return nullptr; } @@ -331,7 +331,7 @@ AudioBuffer::CopyFromChannel(const Float32Array& aDestination, uint32_t aChannel end += length; if (aChannelNumber >= NumberOfChannels() || !end.isValid() || end.value() > Length()) { - aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; } @@ -375,7 +375,7 @@ AudioBuffer::CopyToChannel(JSContext* aJSContext, const Float32Array& aSource, end += length; if (aChannelNumber >= NumberOfChannels() || !end.isValid() || end.value() > Length()) { - aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR); + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; } @@ -406,7 +406,7 @@ AudioBuffer::GetChannelData(JSContext* aJSContext, uint32_t aChannel, ErrorResult& aRv) { if (aChannel >= NumberOfChannels()) { - aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR); + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; }