Index: Source/modules/webaudio/OfflineAudioContext.cpp |
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp |
index 71dccde0905ad1c8f7c631c55ed21044afa3bb51..d780fac53ec1e6c00c90b8fdc41400cc1b328dbf 100644 |
--- a/Source/modules/webaudio/OfflineAudioContext.cpp |
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp |
@@ -53,8 +53,16 @@ PassRefPtr<OfflineAudioContext> OfflineAudioContext::create(ExecutionContext* co |
return nullptr; |
} |
- if (numberOfChannels > 10) { |
- exceptionState.throwDOMException(SyntaxError, "number of channels (" + String::number(numberOfChannels) + ") exceeds maximum (10)."); |
+ if (numberOfChannels > AudioContext::maxNumberOfChannels()) { |
+ exceptionState.throwDOMException( |
+ IndexSizeError, |
+ ExceptionMessages::indexOutsideRange<unsigned>( |
+ "number of channels", |
+ numberOfChannels, |
+ 0, |
+ ExceptionMessages::InclusiveBound, |
+ AudioContext::maxNumberOfChannels(), |
+ ExceptionMessages::InclusiveBound)); |
return nullptr; |
} |