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

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

Issue 2000483002: Clean up V8 bindings template code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/V8TestDictionaryDerived.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
index ac571d8ca8e05b114a5017be9903d43da53b8741..5abbbd99d0e42e65fce912488b4575d7ca6364bf 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
@@ -32,69 +32,61 @@ void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
exceptionState.rethrowV8Exception(block.Exception());
return;
}
- {
- v8::Local<v8::Value> derivedStringMemberValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMember")).ToLocal(&derivedStringMemberValue)) {
- exceptionState.rethrowV8Exception(block.Exception());
+ v8::Local<v8::Value> derivedStringMemberValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMember")).ToLocal(&derivedStringMemberValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ V8StringResource<> derivedStringMember = derivedStringMemberValue;
+ if (!derivedStringMember.prepare(exceptionState))
return;
- }
- if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefined()) {
- // Do nothing.
- } else {
- V8StringResource<> derivedStringMember = derivedStringMemberValue;
- if (!derivedStringMember.prepare(exceptionState))
- return;
- impl.setDerivedStringMember(derivedStringMember);
- }
+ impl.setDerivedStringMember(derivedStringMember);
}
- {
- v8::Local<v8::Value> derivedStringMemberWithDefaultValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMemberWithDefault")).ToLocal(&derivedStringMemberWithDefaultValue)) {
- exceptionState.rethrowV8Exception(block.Exception());
+ v8::Local<v8::Value> derivedStringMemberWithDefaultValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMemberWithDefault")).ToLocal(&derivedStringMemberWithDefaultValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWithDefaultValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ V8StringResource<> derivedStringMemberWithDefault = derivedStringMemberWithDefaultValue;
+ if (!derivedStringMemberWithDefault.prepare(exceptionState))
return;
- }
- if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWithDefaultValue->IsUndefined()) {
- // Do nothing.
- } else {
- V8StringResource<> derivedStringMemberWithDefault = derivedStringMemberWithDefaultValue;
- if (!derivedStringMemberWithDefault.prepare(exceptionState))
- return;
- impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault);
- }
+ impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault);
}
- {
- v8::Local<v8::Value> requiredLongMemberValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "requiredLongMember")).ToLocal(&requiredLongMemberValue)) {
- exceptionState.rethrowV8Exception(block.Exception());
- return;
- }
- if (requiredLongMemberValue.IsEmpty() || requiredLongMemberValue->IsUndefined()) {
- exceptionState.throwTypeError("required member requiredLongMember is undefined.");
+ v8::Local<v8::Value> requiredLongMemberValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "requiredLongMember")).ToLocal(&requiredLongMemberValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (requiredLongMemberValue.IsEmpty() || requiredLongMemberValue->IsUndefined()) {
+ exceptionState.throwTypeError("required member requiredLongMember is undefined.");
+ return;
+ } else {
+ int requiredLongMember = toInt32(isolate, requiredLongMemberValue, NormalConversion, exceptionState);
+ if (exceptionState.hadException())
return;
- } else {
- int requiredLongMember = toInt32(isolate, requiredLongMemberValue, NormalConversion, exceptionState);
- if (exceptionState.hadException())
- return;
- impl.setRequiredLongMember(requiredLongMember);
- }
+ impl.setRequiredLongMember(requiredLongMember);
}
- {
- v8::Local<v8::Value> stringOrDoubleSequenceMemberValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrDoubleSequenceMember")).ToLocal(&stringOrDoubleSequenceMemberValue)) {
- exceptionState.rethrowV8Exception(block.Exception());
+ v8::Local<v8::Value> stringOrDoubleSequenceMemberValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrDoubleSequenceMember")).ToLocal(&stringOrDoubleSequenceMemberValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (stringOrDoubleSequenceMemberValue.IsEmpty() || stringOrDoubleSequenceMemberValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ HeapVector<StringOrDouble> stringOrDoubleSequenceMember = toImplArray<HeapVector<StringOrDouble>>(stringOrDoubleSequenceMemberValue, 0, isolate, exceptionState);
+ if (exceptionState.hadException())
return;
- }
- if (stringOrDoubleSequenceMemberValue.IsEmpty() || stringOrDoubleSequenceMemberValue->IsUndefined()) {
- // Do nothing.
- } else {
- HeapVector<StringOrDouble> stringOrDoubleSequenceMember = toImplArray<HeapVector<StringOrDouble>>(stringOrDoubleSequenceMemberValue, 0, isolate, exceptionState);
- if (exceptionState.hadException())
- return;
- impl.setStringOrDoubleSequenceMember(stringOrDoubleSequenceMember);
- }
+ impl.setStringOrDoubleSequenceMember(stringOrDoubleSequenceMember);
}
}

Powered by Google App Engine
This is Rietveld 408576698