| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 ' return Dart_IsNull(handle) ? 0 : toNative(handle, exception);\n
' | 329 ' return Dart_IsNull(handle) ? 0 : toNative(handle, exception);\n
' |
| 330 ' }\n', | 330 ' }\n', |
| 331 RETURN_TYPE=return_type, | 331 RETURN_TYPE=return_type, |
| 332 TO_NATIVE_BODY=to_native_body, | 332 TO_NATIVE_BODY=to_native_body, |
| 333 INTERFACE=self._interface.id) | 333 INTERFACE=self._interface.id) |
| 334 | 334 |
| 335 to_dart_emitter = emitter.Emitter() | 335 to_dart_emitter = emitter.Emitter() |
| 336 | 336 |
| 337 ext_attrs = self._interface.ext_attrs | 337 ext_attrs = self._interface.ext_attrs |
| 338 | 338 |
| 339 if ('CustomToJS' in ext_attrs or | 339 if ('CustomToV8' in ext_attrs or |
| 340 ('CustomToJSObject' in ext_attrs and 'TypedArray' not in ext_attrs) or | |
| 341 'PureInterface' in ext_attrs or | 340 'PureInterface' in ext_attrs or |
| 342 'CPPPureInterface' in ext_attrs or | 341 'CPPPureInterface' in ext_attrs or |
| 343 self._interface_type_info.custom_to_dart()): | 342 self._interface_type_info.custom_to_dart()): |
| 344 to_dart_emitter.Emit( | 343 to_dart_emitter.Emit( |
| 345 ' static Dart_Handle toDart(NativeType* value);\n') | 344 ' static Dart_Handle toDart(NativeType* value);\n') |
| 346 else: | 345 else: |
| 347 to_dart_emitter.Emit( | 346 to_dart_emitter.Emit( |
| 348 ' static Dart_Handle toDart(NativeType* value)\n' | 347 ' static Dart_Handle toDart(NativeType* value)\n' |
| 349 ' {\n' | 348 ' {\n' |
| 350 ' return DartDOMWrapper::toDart<Dart$(INTERFACE)>(value);\n' | 349 ' return DartDOMWrapper::toDart<Dart$(INTERFACE)>(value);\n' |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' | 1018 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' |
| 1020 ' return func;\n', | 1019 ' return func;\n', |
| 1021 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) | 1020 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) |
| 1022 | 1021 |
| 1023 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1022 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1024 return ( | 1023 return ( |
| 1025 interface.id.endswith('Event') and | 1024 interface.id.endswith('Event') and |
| 1026 operation.id.startswith('init') and | 1025 operation.id.startswith('init') and |
| 1027 argument.ext_attrs.get('Default') == 'Undefined' and | 1026 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1028 argument.type.id == 'DOMString') | 1027 argument.type.id == 'DOMString') |
| OLD | NEW |