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 import logging | 10 import logging |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 pass | 672 pass |
673 | 673 |
674 def AdditionalImplementedInterfaces(self): | 674 def AdditionalImplementedInterfaces(self): |
675 implements = super(Dart2JSBackend, self).AdditionalImplementedInterfaces() | 675 implements = super(Dart2JSBackend, self).AdditionalImplementedInterfaces() |
676 if self._interface_type_info.list_item_type() and self.HasIndexedGetter(): | 676 if self._interface_type_info.list_item_type() and self.HasIndexedGetter(): |
677 implements.append('JavaScriptIndexingBehavior') | 677 implements.append('JavaScriptIndexingBehavior') |
678 return implements | 678 return implements |
679 | 679 |
680 def NativeSpec(self): | 680 def NativeSpec(self): |
681 native_spec = MakeNativeSpec(self._interface.javascript_binding_name) | 681 native_spec = MakeNativeSpec(self._interface.javascript_binding_name) |
682 return ' native "%s"' % native_spec | 682 return '@Native("%s")\n' % native_spec |
683 | 683 |
684 def ImplementationTemplate(self): | 684 def ImplementationTemplate(self): |
685 template_file = ('impl_%s.darttemplate' % | 685 template_file = ('impl_%s.darttemplate' % |
686 self._interface.doc_js_name) | 686 self._interface.doc_js_name) |
687 return (self._template_loader.TryLoad(template_file) or | 687 return (self._template_loader.TryLoad(template_file) or |
688 self._template_loader.Load('dart2js_impl.darttemplate')) | 688 self._template_loader.Load('dart2js_impl.darttemplate')) |
689 | 689 |
690 def StartInterface(self, members_emitter): | 690 def StartInterface(self, members_emitter): |
691 self._members_emitter = members_emitter | 691 self._members_emitter = members_emitter |
692 | 692 |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 | 1266 |
1267 def AddFile(self, basename, library_name, path): | 1267 def AddFile(self, basename, library_name, path): |
1268 self._libraries[library_name].AddFile(path) | 1268 self._libraries[library_name].AddFile(path) |
1269 | 1269 |
1270 def AddTypeEntry(self, library_name, idl_name, dart_name): | 1270 def AddTypeEntry(self, library_name, idl_name, dart_name): |
1271 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) | 1271 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) |
1272 | 1272 |
1273 def Emit(self, emitter, auxiliary_dir): | 1273 def Emit(self, emitter, auxiliary_dir): |
1274 for lib in self._libraries.values(): | 1274 for lib in self._libraries.values(): |
1275 lib.Emit(emitter, auxiliary_dir) | 1275 lib.Emit(emitter, auxiliary_dir) |
OLD | NEW |