| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module provides shared functionality for the systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 import os | 10 import os |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 cpp_callback_name, | 423 cpp_callback_name, |
| 424 True, | 424 True, |
| 425 function_expression, | 425 function_expression, |
| 426 attr, | 426 attr, |
| 427 [], | 427 [], |
| 428 attr.type.id, | 428 attr.type.id, |
| 429 attr.get_raises) | 429 attr.get_raises) |
| 430 | 430 |
| 431 def _AddSetter(self, attr, html_name): | 431 def _AddSetter(self, attr, html_name): |
| 432 type_info = self._TypeInfo(attr.type.id) | 432 type_info = self._TypeInfo(attr.type.id) |
| 433 dart_declaration = 'void set %s(%s)' % (html_name, self._DartType(attr.type.
id)) | 433 dart_declaration = 'void set %s(%s value)' % (html_name, self._DartType(attr
.type.id)) |
| 434 is_custom = set(['Custom', 'CustomSetter', 'V8CustomSetter']) & set(attr.ext
_attrs) | 434 is_custom = set(['Custom', 'CustomSetter', 'V8CustomSetter']) & set(attr.ext
_attrs) |
| 435 cpp_callback_name = self._GenerateNativeBinding(attr.id, 2, | 435 cpp_callback_name = self._GenerateNativeBinding(attr.id, 2, |
| 436 dart_declaration, 'Setter', is_custom) | 436 dart_declaration, 'Setter', is_custom) |
| 437 if is_custom: | 437 if is_custom: |
| 438 return | 438 return |
| 439 | 439 |
| 440 if 'Reflect' in attr.ext_attrs: | 440 if 'Reflect' in attr.ext_attrs: |
| 441 webcore_function_name = self._TypeInfo(attr.type.id).webcore_setter_name() | 441 webcore_function_name = self._TypeInfo(attr.type.id).webcore_setter_name() |
| 442 else: | 442 else: |
| 443 webcore_function_name = re.sub(r'^(xml(?=[A-Z])|\w)', | 443 webcore_function_name = re.sub(r'^(xml(?=[A-Z])|\w)', |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 parent_interface = _FindInHierarchy(database, parent_interface, test) | 938 parent_interface = _FindInHierarchy(database, parent_interface, test) |
| 939 if parent_interface: | 939 if parent_interface: |
| 940 return parent_interface | 940 return parent_interface |
| 941 | 941 |
| 942 def _ToWebKitName(name): | 942 def _ToWebKitName(name): |
| 943 name = name[0].lower() + name[1:] | 943 name = name[0].lower() + name[1:] |
| 944 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), | 944 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), |
| 945 name) | 945 name) |
| 946 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize()
, | 946 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize()
, |
| 947 name) | 947 name) |
| OLD | NEW |