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

Unified Diff: Source/bindings/scripts/v8_methods.py

Issue 474323002: IDL: initialize union member variables (to null/zero) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index 2dff48b00498b23a56ce8dc294288474bfa05903..ccb8a964642102f1efa0bc11a9af290c9c3b4cf3 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -406,10 +406,12 @@ def union_member_argument_context(idl_type, index):
"""Returns a context of union member for argument."""
this_cpp_value = 'result%d' % index
this_cpp_type = idl_type.cpp_type
+ this_cpp_type_initializer = idl_type.cpp_type_initializer
cpp_return_value = this_cpp_value
if not idl_type.cpp_type_has_null_value:
this_cpp_type = v8_types.cpp_template_type('Nullable', this_cpp_type)
+ this_cpp_type_initializer = ''
cpp_return_value = '%s.get()' % this_cpp_value
if idl_type.is_string_type:
@@ -419,6 +421,7 @@ def union_member_argument_context(idl_type, index):
return {
'cpp_type': this_cpp_type,
+ 'cpp_type_initializer': this_cpp_type_initializer,
'cpp_value': this_cpp_value,
'null_check_value': null_check_value,
'v8_set_return_value': idl_type.v8_set_return_value(
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698