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

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

Issue 105693002: Generate a bit less code to handle failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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/bindings/tests/results/V8TestObjectPython.cpp
diff --git a/Source/bindings/tests/results/V8TestObjectPython.cpp b/Source/bindings/tests/results/V8TestObjectPython.cpp
index cfbede834d0858509891ed89ecae288803298b2e..179e4b04f3c4cad931e8918413591220d9940c22 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.cpp
+++ b/Source/bindings/tests/results/V8TestObjectPython.cpp
@@ -4724,6 +4724,7 @@ static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodA1Method(info);
return;
@@ -4733,10 +4734,11 @@ static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4775,6 +4777,7 @@ static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodB1Method(info);
return;
@@ -4784,10 +4787,11 @@ static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4822,6 +4826,7 @@ static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodC1Method(info);
return;
@@ -4831,10 +4836,11 @@ static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4868,6 +4874,7 @@ static void overloadedMethodD2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodD1Method(info);
return;
@@ -4877,10 +4884,11 @@ static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4914,6 +4922,7 @@ static void overloadedMethodE2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodE1Method(info);
return;
@@ -4923,10 +4932,11 @@ static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4960,6 +4970,7 @@ static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodF1Method(info);
return;
@@ -4969,10 +4980,11 @@ static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -5116,6 +5128,7 @@ static void overloadedStaticMethod2Method(const v8::FunctionCallbackInfo<v8::Val
static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObjectPython", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedStaticMethod1Method(info);
return;
@@ -5125,10 +5138,11 @@ static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMethod", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMethod", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+ exceptionState.throwTypeError("No function was found that matched the signature provided.");
+ exceptionState.throwIfNeeded();
}
static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698