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

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

Issue 2301993002: binding: Introduces ExceptionToPromiseScope. (Closed)
Patch Set: Addressed review comments (rename, empty line). Created 4 years, 3 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/V8TestInterfaceNamedConstructor.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
index 0db3970a45d8a36772719add611499f47946c405..73664ea6e39455215e70e901136d73f896f83500 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp
@@ -85,58 +85,64 @@ static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio
v8SetReturnValue(info, info.Holder());
return;
}
- ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterfaceNamedConstructor", info.Holder(), info.GetIsolate());
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "TestInterfaceNamedConstructor");
+
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
+
V8StringResource<> stringArg;
bool defaultUndefinedOptionalBooleanArg;
int defaultUndefinedOptionalLongArg;
V8StringResource<> defaultUndefinedOptionalStringArg;
V8StringResource<> defaultNullStringOptionalstringArg;
V8StringResource<> optionalStringArg;
- {
- int numArgsPassed = info.Length();
- while (numArgsPassed > 0) {
- if (!info[numArgsPassed - 1]->IsUndefined())
- break;
- --numArgsPassed;
- }
- stringArg = info[0];
- if (!stringArg.prepare())
- return;
- defaultUndefinedOptionalBooleanArg = toBoolean(info.GetIsolate(), info[1], exceptionState);
- if (exceptionState.hadException())
- return;
- defaultUndefinedOptionalLongArg = toInt32(info.GetIsolate(), info[2], NormalConversion, exceptionState);
- if (exceptionState.hadException())
- return;
- defaultUndefinedOptionalStringArg = info[3];
- if (!defaultUndefinedOptionalStringArg.prepare())
+ int numArgsPassed = info.Length();
+ while (numArgsPassed > 0) {
+ if (!info[numArgsPassed - 1]->IsUndefined())
+ break;
+ --numArgsPassed;
+ }
+ stringArg = info[0];
+ if (!stringArg.prepare())
+ return;
+
+ defaultUndefinedOptionalBooleanArg = toBoolean(info.GetIsolate(), info[1], exceptionState);
+ if (exceptionState.hadException())
+ return;
+
+ defaultUndefinedOptionalLongArg = toInt32(info.GetIsolate(), info[2], NormalConversion, exceptionState);
+ if (exceptionState.hadException())
+ return;
+
+ defaultUndefinedOptionalStringArg = info[3];
+ if (!defaultUndefinedOptionalStringArg.prepare())
+ return;
+
+ if (!info[4]->IsUndefined()) {
+ defaultNullStringOptionalstringArg = info[4];
+ if (!defaultNullStringOptionalstringArg.prepare())
return;
- if (!info[4]->IsUndefined()) {
- defaultNullStringOptionalstringArg = info[4];
- if (!defaultNullStringOptionalstringArg.prepare())
- return;
- } else {
- defaultNullStringOptionalstringArg = nullptr;
- }
- if (UNLIKELY(numArgsPassed <= 5)) {
- Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
- TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg, exceptionState);
- if (exceptionState.hadException()) {
- return;
- }
- v8::Local<v8::Object> wrapper = info.Holder();
- wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrapper);
- v8SetReturnValue(info, wrapper);
+ } else {
+ defaultNullStringOptionalstringArg = nullptr;
+ }
+ if (UNLIKELY(numArgsPassed <= 5)) {
+ Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
+ TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg, exceptionState);
+ if (exceptionState.hadException()) {
return;
}
- optionalStringArg = info[5];
- if (!optionalStringArg.prepare())
- return;
+ v8::Local<v8::Object> wrapper = info.Holder();
+ wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrapper);
+ v8SetReturnValue(info, wrapper);
+ return;
}
+ optionalStringArg = info[5];
+ if (!optionalStringArg.prepare())
+ return;
+
Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOptionalstringArg, optionalStringArg, exceptionState);
if (exceptionState.hadException()) {

Powered by Google App Engine
This is Rietveld 408576698