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 re | 10 import re |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 'SerializedScriptValue': | 687 'SerializedScriptValue': |
688 "@annotation_Creates_SerializedScriptValue " | 688 "@annotation_Creates_SerializedScriptValue " |
689 "@annotation_Returns_SerializedScriptValue", | 689 "@annotation_Returns_SerializedScriptValue", |
690 | 690 |
691 'SQLResultSetRowList.item': "@Creates('=Object')", | 691 'SQLResultSetRowList.item': "@Creates('=Object')", |
692 | 692 |
693 'XMLHttpRequest.response': | 693 'XMLHttpRequest.response': |
694 "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')", | 694 "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')", |
695 } | 695 } |
696 | 696 |
| 697 # Placeholder to add experimental flag, implementation for this is |
| 698 # pending in a separate CL. |
| 699 dart_annotations = { |
| 700 'Element.webkitMatchesSelector': ['@Experimental()'], |
| 701 } |
| 702 |
697 def FindAnnotations(idl_type, interface_name, member_name): | 703 def FindAnnotations(idl_type, interface_name, member_name): |
698 ann1 = dart2js_annotations.get("%s.%s" % (interface_name, member_name)) | 704 ann1 = dart2js_annotations.get("%s.%s" % (interface_name, member_name)) |
699 if ann1: | 705 if ann1: |
700 ann2 = dart2js_annotations.get('+' + idl_type) | 706 ann2 = dart2js_annotations.get('+' + idl_type) |
701 if ann2: | 707 if ann2: |
702 return ann2 + ' ' + ann1 | 708 return ann2 + ' ' + ann1 |
703 ann2 = dart2js_annotations.get(idl_type) | 709 ann2 = dart2js_annotations.get(idl_type) |
704 if ann2: | 710 if ann2: |
705 return ann2 + ' ' + ann1 | 711 return ann2 + ' ' + ann1 |
706 return ann1 | 712 return ann1 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 self) | 1248 self) |
1243 | 1249 |
1244 if type_data.clazz == 'SVGTearOff': | 1250 if type_data.clazz == 'SVGTearOff': |
1245 dart_interface_name = self._renamer.RenameInterface( | 1251 dart_interface_name = self._renamer.RenameInterface( |
1246 self._database.GetInterface(type_name)) | 1252 self._database.GetInterface(type_name)) |
1247 return SVGTearOffIDLTypeInfo( | 1253 return SVGTearOffIDLTypeInfo( |
1248 type_name, type_data, dart_interface_name, self) | 1254 type_name, type_data, dart_interface_name, self) |
1249 | 1255 |
1250 class_name = '%sIDLTypeInfo' % type_data.clazz | 1256 class_name = '%sIDLTypeInfo' % type_data.clazz |
1251 return globals()[class_name](type_name, type_data) | 1257 return globals()[class_name](type_name, type_data) |
OLD | NEW |