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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp

Issue 2061113002: Remove ExceptionState::throwIfNeeded Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
index 4361804b7751dc6b2726570335f32a7ec22e316b..defca796b85d8582b382dd17dc02b5b7adfba3ed 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
@@ -58,7 +58,6 @@ static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setAttr1(cppValue);
@@ -100,7 +99,6 @@ static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->keysForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -118,7 +116,6 @@ static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -136,7 +133,6 @@ static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -152,7 +148,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
@@ -161,7 +156,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (!info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
- exceptionState.throwIfNeeded();
return;
}
callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
@@ -170,7 +164,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -185,20 +178,19 @@ static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
V8StringResource<> value;
{
value = info[0];
- if (!value.prepare())
+ if (!value.prepare()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->hasForBinding(scriptState, value, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueBool(info, result);
@@ -214,20 +206,19 @@ static void addMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
V8StringResource<> value;
{
value = info[0];
- if (!value.prepare())
+ if (!value.prepare()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
TestInterfaceGarbageCollected* result = impl->addForBinding(scriptState, value, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -245,7 +236,6 @@ static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->clearForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -260,20 +250,19 @@ static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
V8StringResource<> value;
{
value = info[0];
- if (!value.prepare())
+ if (!value.prepare()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->deleteForBinding(scriptState, value, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueBool(info, result);
@@ -291,7 +280,6 @@ static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->iterator(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -311,8 +299,9 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
V8StringResource<> str;
{
str = info[0];
- if (!str.prepare())
+ if (!str.prepare()) {
return;
+ }
}
TestInterfaceGarbageCollected* impl = TestInterfaceGarbageCollected::create(str);
v8::Local<v8::Object> wrapper = info.Holder();

Powered by Google App Engine
This is Rietveld 408576698