Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Issue 2656993002: Throw TypeError instead of InvalidAccessError for invalid times (Closed)
Patch Set: Address review comments and clang-format it Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
index b96cc3a92698132c5d360216c0a4553a3218f6ca..768273db219f18a3308f7272ecdea9f3284e7648 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -61,9 +61,9 @@ static bool IsNonNegativeAudioParamTime(double time,
if (time >= 0)
return true;
- exception_state.ThrowDOMException(
- kInvalidAccessError, message + " must be a finite non-negative number: " +
- String::Number(time));
+ exception_state.ThrowRangeError(
+ message +
+ " must be a finite non-negative number: " + String::Number(time));
return false;
}
@@ -73,8 +73,7 @@ static bool IsPositiveAudioParamTime(double time,
if (time > 0)
return true;
- exception_state.ThrowDOMException(
- kInvalidAccessError,
+ exception_state.ThrowRangeError(
message + " must be a finite positive number: " + String::Number(time));
return false;
}
@@ -444,12 +443,11 @@ void AudioParamTimeline::ExponentialRampToValueAtTime(
return;
if (!value) {
- exception_state.ThrowDOMException(
- kInvalidAccessError,
+ exception_state.ThrowRangeError(
"The float target value provided (" + String::Number(value) +
- ") should not be in the range (" +
- String::Number(-std::numeric_limits<float>::denorm_min()) + ", " +
- String::Number(std::numeric_limits<float>::denorm_min()) + ").");
+ ") should not be in the range (" +
+ String::Number(-std::numeric_limits<float>::denorm_min()) + ", " +
+ String::Number(std::numeric_limits<float>::denorm_min()) + ").");
return;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698