Chromium Code Reviews| Index: lib/dom/scripts/generator.py |
| diff --git a/lib/dom/scripts/generator.py b/lib/dom/scripts/generator.py |
| index d7a2fe126b966bdf3aab202087d1a6bd270b1d64..198c0cfaf63e68511e1b25d1731781a44fafa3ba 100644 |
| --- a/lib/dom/scripts/generator.py |
| +++ b/lib/dom/scripts/generator.py |
| @@ -7,7 +7,6 @@ |
| Dart APIs from the IDL database.""" |
| import re |
| -import string |
| _pure_interfaces = set([ |
| 'DOMStringMap', |
| @@ -543,13 +542,9 @@ class PrimitiveIDLTypeInfo(IDLTypeInfo): |
| conversion_arguments = [value] |
| if attributes and 'TreatReturnedNullStringAs' in attributes: |
| conversion_arguments.append('DartUtilities::ConvertNullToDefaultValue') |
| - function_name = 'toDartValue' |
| - # FIXME: implement DartUtilities::toDart for other primitive types and |
| - # remove this list. |
| - if self.native_type() in ['String', 'bool', 'int', 'unsigned', 'long long', 'unsigned long long', 'double']: |
| - function_name = string.capwords(self.native_type()).replace(' ', '') |
| - function_name = function_name[0].lower() + function_name[1:] |
| - function_name = 'DartUtilities::%sToDart' % function_name |
| + function_name = re.sub(r' [a-z]', lambda x: x.group(0)[1:].upper(), self.native_type()) |
|
Anton Muhin
2012/04/25 10:05:18
nit.
I am probably biased here, but is it more re
podivilov
2012/04/25 11:12:58
I've changed this logic for ScriptValue -> scriptV
Anton Muhin
2012/04/25 13:09:55
I see, thanks for explanations.
Still maybe: def
|
| + function_name = function_name[0].lower() + function_name[1:] |
| + function_name = 'DartUtilities::%sToDart' % function_name |
| return '%s(%s)' % (function_name, ', '.join(conversion_arguments)) |
| def webcore_getter_name(self): |