| 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 the system to generate | 6 """This module provides shared functionality for the system to generate |
| 7 dart:html APIs from the IDL database.""" | 7 dart:html APIs from the IDL database.""" |
| 8 | 8 |
| 9 import emitter | 9 import emitter |
| 10 from generator import AnalyzeOperation, ConstantOutputOrder, \ | 10 from generator import AnalyzeOperation, ConstantOutputOrder, \ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 else: | 45 else: |
| 46 signature = check[0] | 46 signature = check[0] |
| 47 check = check[1] | 47 check = check[1] |
| 48 self._members_emitter.Emit('\n' | 48 self._members_emitter.Emit('\n' |
| 49 ' /// Checks if this type is supported on the current platform.\n' | 49 ' /// Checks if this type is supported on the current platform.\n' |
| 50 ' static bool $SIGNATURE => $SUPPORT_CHECK;\n', | 50 ' static bool $SIGNATURE => $SUPPORT_CHECK;\n', |
| 51 SIGNATURE=signature, SUPPORT_CHECK=check) | 51 SIGNATURE=signature, SUPPORT_CHECK=check) |
| 52 | 52 |
| 53 def EmitEventGetter(self, events_class_name): | 53 def EmitEventGetter(self, events_class_name): |
| 54 self._members_emitter.Emit( | 54 self._members_emitter.Emit( |
| 55 "\n @DocsEditable" | 55 "\n @DocsEditable()" |
| 56 "\n @DomName('EventTarget.addEventListener, " | 56 "\n @DomName('EventTarget.addEventListener, " |
| 57 "EventTarget.removeEventListener, EventTarget.dispatchEvent')" | 57 "EventTarget.removeEventListener, EventTarget.dispatchEvent')" |
| 58 "\n @deprecated" | 58 "\n @deprecated" |
| 59 "\n $TYPE get on =>\n new $TYPE(this);\n", | 59 "\n $TYPE get on =>\n new $TYPE(this);\n", |
| 60 TYPE=events_class_name) | 60 TYPE=events_class_name) |
| 61 | 61 |
| 62 def AddMembers(self, interface, declare_only=False): | 62 def AddMembers(self, interface, declare_only=False): |
| 63 for const in sorted(interface.constants, ConstantOutputOrder): | 63 for const in sorted(interface.constants, ConstantOutputOrder): |
| 64 self.AddConstant(const) | 64 self.AddConstant(const) |
| 65 | 65 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 if interface.parents: | 593 if interface.parents: |
| 594 parent = interface.parents[0] | 594 parent = interface.parents[0] |
| 595 if IsPureInterface(parent.type.id): | 595 if IsPureInterface(parent.type.id): |
| 596 walk(interface.parents) | 596 walk(interface.parents) |
| 597 else: | 597 else: |
| 598 walk(interface.parents[1:]) | 598 walk(interface.parents[1:]) |
| 599 return result | 599 return result |
| 600 | 600 |
| 601 def _DartType(self, type_name): | 601 def _DartType(self, type_name): |
| 602 return self._type_registry.DartType(type_name) | 602 return self._type_registry.DartType(type_name) |
| OLD | NEW |