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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index b585d6eaeafe54903b5b6ab4419c513cecd715f9..7b7fe8cf554ce920e3ab8b14dc0faee59169b574 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -149,7 +149,6 @@ static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
{##############################################################################}
-{% from 'methods.cpp' import union_type_method_call_and_set_return_value %}
{% block named_property_getter %}
{% if named_property_getter and not named_property_getter.is_custom %}
{% set getter = named_property_getter %}
@@ -168,10 +167,12 @@ static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
v8::String::Utf8Value namedProperty(name);
ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "{{interface_name}}", info.Holder(), info.GetIsolate());
{% endif %}
- {% if getter.union_arguments %}
- {{union_type_method_call_and_set_return_value(getter) | indent}}
+ {% if getter.use_output_parameter_for_result %}
+ {{getter.cpp_type}} result;
+ {{getter.cpp_value}};
{% else %}
{{getter.cpp_type}} result = {{getter.cpp_value}};
+ {% endif %}
{% if getter.is_raises_exception %}
if (exceptionState.throwIfNeeded())
return;
@@ -179,7 +180,6 @@ static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
if ({{getter.is_null_expression}})
return;
{{getter.v8_set_return_value}};
- {% endif %}
}
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698