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

Unified Diff: Source/modules/crypto/Crypto.cpp

Issue 235123002: Should throw TypeError instead of TypeMismatchError (modules) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
Index: Source/modules/crypto/Crypto.cpp
diff --git a/Source/modules/crypto/Crypto.cpp b/Source/modules/crypto/Crypto.cpp
index a5d40861a0ace80ebdb4a9703513b7b43c3f19da..d54a14a04b0ff150a0d17d9edf7341b9720be1bf 100644
--- a/Source/modules/crypto/Crypto.cpp
+++ b/Source/modules/crypto/Crypto.cpp
@@ -61,11 +61,11 @@ Crypto::Crypto()
void Crypto::getRandomValues(ArrayBufferView* array, ExceptionState& exceptionState)
{
if (!array) {
- exceptionState.throwDOMException(TypeMismatchError, "The provided ArrayBufferView is null.");
+ exceptionState.throwDOMException(TypeError, "The provided ArrayBufferView is null.");
return;
}
if (!isIntegerArray(array)) {
- exceptionState.throwDOMException(TypeMismatchError, String::format("The provided ArrayBufferView is of type '%s', which is not an integer array type.", array->typeName()));
+ exceptionState.throwDOMException(TypeError, String::format("The provided ArrayBufferView is of type '%s', which is not an integer array type.", array->typeName()));
return;
}
if (array->byteLength() > 65536) {

Powered by Google App Engine
This is Rietveld 408576698