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

Unified Diff: Source/bindings/v8/custom/V8ElementCustom.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/V8Binding.cpp ('k') | Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8ElementCustom.cpp
diff --git a/Source/bindings/v8/custom/V8ElementCustom.cpp b/Source/bindings/v8/custom/V8ElementCustom.cpp
index 0aad602df30789e305f9ee4523acf6e7d58456d2..c056c7b2f85a944e457b683cebcf9ee5a8b6abc9 100644
--- a/Source/bindings/v8/custom/V8ElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8ElementCustom.cpp
@@ -164,6 +164,7 @@ void animate6Method(const v8::FunctionCallbackInfo<v8::Value>& info)
void V8Element::animateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), isolate);
// AnimationPlayer animate(
// (AnimationEffect or sequence<Dictionary>)? effect,
// optional (double or Dictionary) timing);
@@ -229,11 +230,10 @@ void V8Element::animateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
break;
- }
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "animate", "Element", info.Holder(), isolate);
- if (UNLIKELY(info.Length() < 1)) {
- throwArityTypeError(exceptionState, 1, info.Length());
+ default:
+ throwArityTypeError(exceptionState, "[1]", 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/V8Binding.cpp ('k') | Source/bindings/v8/custom/V8SubtleCryptoCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698