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

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

Issue 1310443005: [bindings] Compact ConstantConfiguration by using |union| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/constants.cpp
diff --git a/Source/bindings/templates/constants.cpp b/Source/bindings/templates/constants.cpp
index b88c373a8e0f2b0b03028df38dce0a9f5aa47d4e..67054067b40ff65eccfe5c417751321e03077d64 100644
--- a/Source/bindings/templates/constants.cpp
+++ b/Source/bindings/templates/constants.cpp
@@ -60,12 +60,12 @@ static_assert({{constant.value}} == {{constant_cpp_class}}::{{constant.reflected
{######################################}
{%- macro constant_configuration(constant) %}
{% if constant.idl_type in ('Double', 'Float') %}
- {% set value = '0, %s, 0' % constant.value %}
+ {% set value = '%sf' % constant.value %}
{% elif constant.idl_type == 'String' %}
- {% set value = '0, 0, "%s"' % constant.value %}
+ {% set value = '"%s"' % constant.value %}
{% else %}
{# 'Short', 'Long' etc. #}
- {% set value = '%s, 0, 0' % constant.value %}
+ {% set value = '%s' % constant.value %}
{% endif %}
{"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_type}}}
{%- endmacro %}
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.h ('k') | Source/bindings/tests/results/core/V8TestException.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698