| 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 systems to generate | 6 """This module provides shared functionality for systems to generate |
| 7 Dart APIs from the IDL database.""" | 7 Dart APIs from the IDL database.""" |
| 8 | 8 |
| 9 import copy | 9 import copy |
| 10 import json | 10 import json |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 # | 478 # |
| 479 # where DIRECTION is 'get' for getters and operation return values, 'set' for | 479 # where DIRECTION is 'get' for getters and operation return values, 'set' for |
| 480 # setters and operation arguments. INTERFACE and MEMBER are the idl names. | 480 # setters and operation arguments. INTERFACE and MEMBER are the idl names. |
| 481 # | 481 # |
| 482 | 482 |
| 483 _serialize_SSV = Conversion('convertDartToNative_SerializedScriptValue', | 483 _serialize_SSV = Conversion('convertDartToNative_SerializedScriptValue', |
| 484 'dynamic', 'dynamic') | 484 'dynamic', 'dynamic') |
| 485 | 485 |
| 486 dart2js_conversions = monitored.Dict('generator.dart2js_conversions', { | 486 dart2js_conversions = monitored.Dict('generator.dart2js_conversions', { |
| 487 'Date get': | 487 'Date get': |
| 488 Conversion('_convertNativeToDart_DateTime', 'dynamic', 'DateTime'), | 488 Conversion('convertNativeToDart_DateTime', 'dynamic', 'DateTime'), |
| 489 'Date set': | 489 'Date set': |
| 490 Conversion('_convertDartToNative_DateTime', 'DateTime', 'dynamic'), | 490 Conversion('convertDartToNative_DateTime', 'DateTime', 'dynamic'), |
| 491 # Wrap non-local Windows. We need to check EventTarget (the base type) | 491 # Wrap non-local Windows. We need to check EventTarget (the base type) |
| 492 # as well. Note, there are no functions that take a non-local Window | 492 # as well. Note, there are no functions that take a non-local Window |
| 493 # as a parameter / setter. | 493 # as a parameter / setter. |
| 494 'DOMWindow get': | 494 'DOMWindow get': |
| 495 Conversion('_convertNativeToDart_Window', 'dynamic', 'WindowBase'), | 495 Conversion('_convertNativeToDart_Window', 'dynamic', 'WindowBase'), |
| 496 'EventTarget get': | 496 'EventTarget get': |
| 497 Conversion('_convertNativeToDart_EventTarget', 'dynamic', | 497 Conversion('_convertNativeToDart_EventTarget', 'dynamic', |
| 498 'EventTarget'), | 498 'EventTarget'), |
| 499 'EventTarget set': | 499 'EventTarget set': |
| 500 Conversion('_convertDartToNative_EventTarget', 'EventTarget', | 500 Conversion('_convertDartToNative_EventTarget', 'EventTarget', |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 type_name, type_data, dart_interface_name, self) | 1153 type_name, type_data, dart_interface_name, self) |
| 1154 | 1154 |
| 1155 if type_data.clazz == 'BasicTypedList': | 1155 if type_data.clazz == 'BasicTypedList': |
| 1156 dart_interface_name = self._renamer.RenameInterface( | 1156 dart_interface_name = self._renamer.RenameInterface( |
| 1157 self._database.GetInterface(type_name)) | 1157 self._database.GetInterface(type_name)) |
| 1158 return BasicTypedListIDLTypeInfo( | 1158 return BasicTypedListIDLTypeInfo( |
| 1159 type_name, type_data, dart_interface_name, self) | 1159 type_name, type_data, dart_interface_name, self) |
| 1160 | 1160 |
| 1161 class_name = '%sIDLTypeInfo' % type_data.clazz | 1161 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1162 return globals()[class_name](type_name, type_data) | 1162 return globals()[class_name](type_name, type_data) |
| OLD | NEW |