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

Unified Diff: Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly Created 6 years, 7 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 | « Source/bindings/v8/custom/V8ElementCustom.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp
diff --git a/Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp b/Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp
index a8a40d9b2b23f2774753bfeb945ce917e57a1c29..5fd4452abe5cfa79965d028f24d0f8964fcaf273 100644
--- a/Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp
+++ b/Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp
@@ -80,6 +80,7 @@ void verify4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
void V8SubtleCrypto::verifyMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "verify", "SubtleCrypto", info.Holder(), isolate);
// typedef (ArrayBuffer or ArrayBufferView) CryptoOperationData;
//
// Promise verify(Dictionary algorithm, Key key,
@@ -112,11 +113,10 @@ void V8SubtleCrypto::verifyMethodCustom(const v8::FunctionCallbackInfo<v8::Value
return;
}
break;
- }
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "verify", "SubtleCrypto", info.Holder(), isolate);
- if (UNLIKELY(info.Length() < 4)) {
- throwArityTypeError(exceptionState, 4, info.Length());
+ default:
+ throwArityTypeError(exceptionState, "[4]", info.Length());
return;
+ break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
exceptionState.throwIfNeeded();
« no previous file with comments | « Source/bindings/v8/custom/V8ElementCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698