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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.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/V8TestInterfaceEventInit.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
index 6b14867610f7fe26ead4fa121b1575f445bd410a..fda4cf4fbabecdd1371b2d594760c22262d40c32 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp
@@ -31,20 +31,18 @@ void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local<v8::Value>
exceptionState.rethrowV8Exception(block.Exception());
return;
}
- {
- v8::Local<v8::Value> stringMemberValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) {
- exceptionState.rethrowV8Exception(block.Exception());
+ v8::Local<v8::Value> stringMemberValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ V8StringResource<> stringMember = stringMemberValue;
+ if (!stringMember.prepare(exceptionState))
return;
- }
- if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) {
- // Do nothing.
- } else {
- V8StringResource<> stringMember = stringMemberValue;
- if (!stringMember.prepare(exceptionState))
- return;
- impl.setStringMember(stringMember);
- }
+ impl.setStringMember(stringMember);
}
}

Powered by Google App Engine
This is Rietveld 408576698