Chromium Code Reviews| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 "@Creates('Null')", | 151 "@Creates('Null')", |
| 152 "@Returns('EventTarget|=Object')", | 152 "@Returns('EventTarget|=Object')", |
| 153 ], | 153 ], |
| 154 | 154 |
| 155 # Only nodes in the DOM bubble and have target !== currentTarget. | 155 # Only nodes in the DOM bubble and have target !== currentTarget. |
| 156 'Event.target': [ | 156 'Event.target': [ |
| 157 "@Creates('Node')", | 157 "@Creates('Node')", |
| 158 "@Returns('EventTarget|=Object')", | 158 "@Returns('EventTarget|=Object')", |
| 159 ], | 159 ], |
| 160 | 160 |
| 161 # TODO(sra): Investigate how ExtendableMessageEvent.data is different from | |
| 162 # MessageEvent.data. It might be necessary to put in a method to translate | |
| 163 # the JavaScript wire type into a Dart type. | |
|
Jacob
2017/05/12 02:41:36
Yeah this is most likely busted as is.
| |
| 164 'ExtendableMessageEvent.data': [ | |
| 165 "@annotation_Creates_SerializedScriptValue", | |
| 166 "@annotation_Returns_SerializedScriptValue", | |
| 167 ], | |
| 168 | |
| 169 # TODO(sra): We could determine the following by parsing the compound IDL | |
| 170 # type. | |
| 171 'ExtendableMessageEvent.source': [ | |
| 172 "@Creates('Client|_ServiceWorker|MessagePort')", | |
| 173 "@Returns('Client|_ServiceWorker|MessagePort|Null')", | |
| 174 ], | |
| 175 | |
| 161 'File.lastModifiedDate': [ | 176 'File.lastModifiedDate': [ |
| 162 "@Creates('Null')", # JS date object. | 177 "@Creates('Null')", # JS date object. |
| 163 ], | 178 ], |
| 164 | 179 |
| 165 'FocusEvent.relatedTarget': [ | 180 'FocusEvent.relatedTarget': [ |
| 166 "@Creates('Null')", | 181 "@Creates('Null')", |
| 167 ], | 182 ], |
| 168 | 183 |
| 169 'Gamepad.buttons': [ | 184 'Gamepad.buttons': [ |
| 170 "@Creates('JSExtendableArray|GamepadButton')", | 185 "@Creates('JSExtendableArray|GamepadButton')", |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 906 pass | 921 pass |
| 907 else: | 922 else: |
| 908 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) | 923 _logger.warn('Unknown support_level - %s:%s' % (interface_id, member_id)) |
| 909 | 924 |
| 910 return annotations | 925 return annotations |
| 911 | 926 |
| 912 def Flush(self): | 927 def Flush(self): |
| 913 json_file = open(self._api_status_path, 'w+') | 928 json_file = open(self._api_status_path, 'w+') |
| 914 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key s=True) | 929 json.dump(self._types, json_file, indent=2, separators=(',', ': '), sort_key s=True) |
| 915 json_file.close() | 930 json_file.close() |
| OLD | NEW |