| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 # something that does not need conversion. | 581 # something that does not need conversion. |
| 582 'IDBAny get IDBRequest.result': | 582 'IDBAny get IDBRequest.result': |
| 583 Conversion('_convertNativeToDart_IDBAny', 'dynamic', 'dynamic'), | 583 Conversion('_convertNativeToDart_IDBAny', 'dynamic', 'dynamic'), |
| 584 | 584 |
| 585 # "source: On getting, returns the IDBObjectStore or IDBIndex that the | 585 # "source: On getting, returns the IDBObjectStore or IDBIndex that the |
| 586 # cursor is iterating. ...". So we should not try to convert it. | 586 # cursor is iterating. ...". So we should not try to convert it. |
| 587 'IDBAny get IDBCursor.source': None, | 587 'IDBAny get IDBCursor.source': None, |
| 588 | 588 |
| 589 # Should be either a DOMString, an Array of DOMStrings or null. | 589 # Should be either a DOMString, an Array of DOMStrings or null. |
| 590 'IDBAny get IDBObjectStore.keyPath': None, | 590 'IDBAny get IDBObjectStore.keyPath': None, |
| 591 |
| 592 '* get XMLHttpRequest.response': |
| 593 Conversion('_convertNativeToDart_XHR_Response', |
| 594 'dynamic', 'dynamic'), |
| 591 }, dart2jsOnly=True) | 595 }, dart2jsOnly=True) |
| 592 | 596 |
| 593 def FindConversion(idl_type, direction, interface, member): | 597 def FindConversion(idl_type, direction, interface, member): |
| 594 table = dart2js_conversions | 598 table = dart2js_conversions |
| 595 return (table.get('%s %s %s.%s' % (idl_type, direction, interface, member)) or | 599 return (table.get('%s %s %s.%s' % (idl_type, direction, interface, member)) or |
| 596 table.get('* %s %s.%s' % (direction, interface, member)) or | 600 table.get('* %s %s.%s' % (direction, interface, member)) or |
| 597 table.get('%s %s %s.*' % (idl_type, direction, interface)) or | 601 table.get('%s %s %s.*' % (idl_type, direction, interface)) or |
| 598 table.get('%s %s' % (idl_type, direction))) | 602 table.get('%s %s' % (idl_type, direction))) |
| 599 return None | 603 return None |
| 600 | 604 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 if type_data.clazz == 'BasicTypedList': | 1199 if type_data.clazz == 'BasicTypedList': |
| 1196 if type_name == 'ArrayBuffer': | 1200 if type_name == 'ArrayBuffer': |
| 1197 dart_interface_name = 'ByteBuffer' | 1201 dart_interface_name = 'ByteBuffer' |
| 1198 else: | 1202 else: |
| 1199 dart_interface_name = self._renamer.RenameInterfaceId(type_name) | 1203 dart_interface_name = self._renamer.RenameInterfaceId(type_name) |
| 1200 return BasicTypedListIDLTypeInfo( | 1204 return BasicTypedListIDLTypeInfo( |
| 1201 type_name, type_data, dart_interface_name, self) | 1205 type_name, type_data, dart_interface_name, self) |
| 1202 | 1206 |
| 1203 class_name = '%sIDLTypeInfo' % type_data.clazz | 1207 class_name = '%sIDLTypeInfo' % type_data.clazz |
| 1204 return globals()[class_name](type_name, type_data) | 1208 return globals()[class_name](type_name, type_data) |
| OLD | NEW |