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

Unified Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 221073003: Add helper functions for throwing arity-related TypeErrors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix style nits. Created 6 years, 9 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/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestInterface2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp
index 01dfc92e67771bcbed4802d231602e3bf607d136..10cbfc5275f888e673d09e098d54be392987c125 100644
--- a/Source/bindings/tests/results/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/V8TestInterface.cpp
@@ -746,7 +746,7 @@ static void TestInterfaceImplementationReplaceableAttributeSetterCallback(v8::Lo
static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ throwArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Length(), info.GetIsolate());
return;
}
TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
@@ -809,8 +809,7 @@ static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsComplexMethod", "TestInterface", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
- exceptionState.throwIfNeeded();
+ throwArityTypeError(exceptionState, 2, info.Length());
return;
}
TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
@@ -933,8 +932,7 @@ static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoidMethodLongArg", "TestInterface", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
+ throwArityTypeError(exceptionState, 1, info.Length());
return;
}
TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
@@ -979,7 +977,7 @@ static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallba
static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("partialVoidMethodPartialCallbackTypeArg", "TestInterface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ throwArityTypeErrorForMethod("partialVoidMethodPartialCallbackTypeArg", "TestInterface", 1, info.Length(), info.GetIsolate());
return;
}
TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestInterface2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698