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 to provide Dart metadata for | 6 """This module provides shared functionality to provide Dart metadata for |
7 DOM APIs. | 7 DOM APIs. |
8 """ | 8 """ |
9 | 9 |
10 import copy | 10 import copy |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ], | 119 ], |
120 | 120 |
121 "ErrorEvent.error": [ | 121 "ErrorEvent.error": [ |
122 "@Creates('Null')", # Only returns values created elsewhere. | 122 "@Creates('Null')", # Only returns values created elsewhere. |
123 ], | 123 ], |
124 | 124 |
125 # To be in callback with the browser-created Event, we had to have called | 125 # To be in callback with the browser-created Event, we had to have called |
126 # addEventListener on the target, so we avoid | 126 # addEventListener on the target, so we avoid |
127 'Event.currentTarget': [ | 127 'Event.currentTarget': [ |
128 "@Creates('Null')", | 128 "@Creates('Null')", |
129 "@Returns('EventTarget|=Object')", | 129 "@Returns('EventTarget|=Object|Null')", |
130 ], | 130 ], |
131 | 131 |
132 # Only nodes in the DOM bubble and have target !== currentTarget. | 132 # Only nodes in the DOM bubble and have target !== currentTarget. |
133 'Event.target': [ | 133 'Event.target': [ |
134 "@Creates('Node')", | 134 "@Creates('Node')", |
135 "@Returns('EventTarget|=Object')", | 135 "@Returns('EventTarget|=Object|Null')", |
136 ], | 136 ], |
137 | 137 |
138 'File.lastModifiedDate': [ | 138 'File.lastModifiedDate': [ |
139 "@Creates('Null')", # JS date object. | 139 "@Creates('Null')", # JS date object. |
140 ], | 140 ], |
141 | 141 |
142 'FocusEvent.relatedTarget': [ | 142 'FocusEvent.relatedTarget': [ |
143 "@Creates('Null')", | 143 "@Creates('Null')", |
144 ], | 144 ], |
145 | 145 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 "@Creates('Null')", | 266 "@Creates('Null')", |
267 "@Returns('EventTarget|=Object')", | 267 "@Returns('EventTarget|=Object')", |
268 ], | 268 ], |
269 | 269 |
270 'Metadata.modificationTime': [ | 270 'Metadata.modificationTime': [ |
271 "@Creates('Null')", # JS date object. | 271 "@Creates('Null')", # JS date object. |
272 ], | 272 ], |
273 | 273 |
274 'MouseEvent.relatedTarget': [ | 274 'MouseEvent.relatedTarget': [ |
275 "@Creates('Node')", | 275 "@Creates('Node')", |
276 "@Returns('EventTarget|=Object')", | 276 "@Returns('EventTarget|=Object|Null')", |
277 ], | 277 ], |
278 | 278 |
279 'PopStateEvent.state': [ | 279 'PopStateEvent.state': [ |
280 "@annotation_Creates_SerializedScriptValue", | 280 "@annotation_Creates_SerializedScriptValue", |
281 "@annotation_Returns_SerializedScriptValue", | 281 "@annotation_Returns_SerializedScriptValue", |
282 ], | 282 ], |
283 | 283 |
284 'RTCStatsReport.timestamp': [ | 284 'RTCStatsReport.timestamp': [ |
285 "@Creates('Null')", # JS date object. | 285 "@Creates('Null')", # JS date object. |
286 ], | 286 ], |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 pass | 855 pass |
856 else: | 856 else: |
857 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) | 857 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) |
858 | 858 |
859 return annotations | 859 return annotations |
860 | 860 |
861 def Flush(self): | 861 def Flush(self): |
862 json_file = open(self._api_status_path, 'w+') | 862 json_file = open(self._api_status_path, 'w+') |
863 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) | 863 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key
s=True) |
864 json_file.close() | 864 json_file.close() |
OLD | NEW |