| 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 ' if (!RuntimeEnabledFeatures::$(FEATURE)Enabled()) {\n' | 710 ' if (!RuntimeEnabledFeatures::$(FEATURE)Enabled()) {\n' |
| 711 ' exception = Dart_NewStringFromCString("Feature $FEATURE i
s not enabled");\n' | 711 ' exception = Dart_NewStringFromCString("Feature $FEATURE i
s not enabled");\n' |
| 712 ' goto fail;\n' | 712 ' goto fail;\n' |
| 713 ' }', | 713 ' }', |
| 714 FEATURE=self._ToWebKitName(v8EnabledAtRuntime)) | 714 FEATURE=self._ToWebKitName(v8EnabledAtRuntime)) |
| 715 | 715 |
| 716 body_emitter = self._cpp_definitions_emitter.Emit( | 716 body_emitter = self._cpp_definitions_emitter.Emit( |
| 717 '\n' | 717 '\n' |
| 718 'static void $CALLBACK_NAME(Dart_NativeArguments args)\n' | 718 'static void $CALLBACK_NAME(Dart_NativeArguments args)\n' |
| 719 '{\n' | 719 '{\n' |
| 720 ' DartApiScope dartApiScope;\n' | |
| 721 '$!BODY' | 720 '$!BODY' |
| 722 '}\n', | 721 '}\n', |
| 723 CALLBACK_NAME=callback_name) | 722 CALLBACK_NAME=callback_name) |
| 724 | 723 |
| 725 if raises_exceptions: | 724 if raises_exceptions: |
| 726 body_emitter = body_emitter.Emit( | 725 body_emitter = body_emitter.Emit( |
| 727 ' Dart_Handle exception = 0;\n' | 726 ' Dart_Handle exception = 0;\n' |
| 728 '$!BODY' | 727 '$!BODY' |
| 729 '\n' | 728 '\n' |
| 730 'fail:\n' | 729 'fail:\n' |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' | 1063 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu
mentCount))\n' |
| 1065 ' return func;\n', | 1064 ' return func;\n', |
| 1066 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) | 1065 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) |
| 1067 | 1066 |
| 1068 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): | 1067 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): |
| 1069 return ( | 1068 return ( |
| 1070 interface.id.endswith('Event') and | 1069 interface.id.endswith('Event') and |
| 1071 operation.id.startswith('init') and | 1070 operation.id.startswith('init') and |
| 1072 argument.ext_attrs.get('Default') == 'Undefined' and | 1071 argument.ext_attrs.get('Default') == 'Undefined' and |
| 1073 argument.type.id == 'DOMString') | 1072 argument.type.id == 'DOMString') |
| OLD | NEW |