From 16cac69ac61269a54c0c31fccd2e248504666cdb Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Thu, 3 May 2018 11:40:34 +0200 Subject: [PATCH] Bug 1458673 - In start and stop methods of AudioBufferSourceNode change the throw error to align with the spec. r=dminor MozReview-Commit-ID: 7CwazXg1JWm --HG-- extra : rebase_source : 5c84a5a652d8114c0fe99db584a63732b3ffd420 --- dom/media/webaudio/AudioBufferSourceNode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dom/media/webaudio/AudioBufferSourceNode.cpp b/dom/media/webaudio/AudioBufferSourceNode.cpp index 7a1d9cc80f59..e09dc079264e 100644 --- a/dom/media/webaudio/AudioBufferSourceNode.cpp +++ b/dom/media/webaudio/AudioBufferSourceNode.cpp @@ -702,9 +702,9 @@ void AudioBufferSourceNode::Start(double aWhen, double aOffset, const Optional& aDuration, ErrorResult& aRv) { - if (!WebAudioUtils::IsTimeValid(aWhen) || + if (!WebAudioUtils::IsTimeValid(aWhen) || aOffset < 0 || (aDuration.WasPassed() && !WebAudioUtils::IsTimeValid(aDuration.Value()))) { - aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + aRv.Throw(NS_ERROR_RANGE_ERR); return; } @@ -805,7 +805,7 @@ void AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv) { if (!WebAudioUtils::IsTimeValid(aWhen)) { - aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + aRv.Throw(NS_ERROR_RANGE_ERR); return; }