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

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

Issue 390223004: initialize result variables in v8 bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: more refinements Created 6 years, 5 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 | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 7ad89b54b406ac6d9f16c728b82f35cccbc84d7c..95c9960e694d2dbb4e039b982da6c65fae53650a 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -120,6 +120,19 @@ CPP_SPECIAL_CONVERSION_RULES = {
}
+def cpp_type_initializer(idl_type):
+ """Returns a string containing a C++ initialization statement for the
+ corresponding type.
+
+ |idl_type| argument is of type IdlType.
+ """
+
+ if (idl_type.is_numeric_type):
+ return ' = 0'
+ if idl_type.base_type == 'boolean':
+ return ' = false'
+ return ''
Jens Widell 2014/07/16 07:25:10 Return None by default?
Mostyn Bramley-Moore 2014/07/16 07:46:56 If I do that then we can't blindly use {{attribute
+
Jens Widell 2014/07/16 07:25:10 Two blank lines between function definitions. I'd
Mostyn Bramley-Moore 2014/07/16 07:46:56 Done.
def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_argument=False, used_as_variadic_argument=False, used_in_cpp_sequence=False):
"""Returns C++ type corresponding to IDL type.
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698