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

Unified Diff: Source/bindings/tests/results/V8TestObject.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/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index 4c912c14daddeacbbfc4c1dd0377111d1f646b4a..9d2ef3da0ad19731e35a79f05b45660bbd99763e 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -3077,7 +3077,7 @@ static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatRequiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
- throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAllArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(2, info.Length());
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -4002,6 +4002,7 @@ static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethod1Method(info);
return;
@@ -4023,10 +4024,11 @@ static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "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 overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4066,6 +4068,7 @@ static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
overloadedMethodA1Method(info);
return;
@@ -4075,10 +4078,11 @@ static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", "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)
@@ -4112,6 +4116,7 @@ static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedMethodB1Method(info);
return;
@@ -4121,10 +4126,11 @@ static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", "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)
@@ -4253,7 +4259,7 @@ static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -4275,7 +4281,7 @@ static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringListFunction", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -4404,7 +4410,7 @@ static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPointMethod", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
- throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(2, info.Length());
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -4448,7 +4454,7 @@ static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunction", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 3)) {
- throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(3, info.Length());
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -4623,6 +4629,7 @@ static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedPerWorldMethod1Method(info);
return;
@@ -4632,10 +4639,11 @@ static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Va
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", "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 overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4659,6 +4667,7 @@ static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedPerWorldMethod1MethodForMainWorld(info);
return;
@@ -4668,10 +4677,11 @@ static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbac
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", "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 overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4827,6 +4837,7 @@ static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedActivityLoggedMethod1Method(info);
return;
@@ -4836,10 +4847,11 @@ static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", "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 overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4868,6 +4880,7 @@ static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
if (((info.Length() == 1))) {
overloadedActivityLoggedMethod1MethodForMainWorld(info);
return;
@@ -4877,10 +4890,11 @@ static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionC
return;
}
if (UNLIKELY(info.Length() < 1)) {
- throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+ exceptionState.notEnoughArguments(1, info.Length());
return;
}
- throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", "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 overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698