| 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 | 10 |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 ID=typename, | 556 ID=typename, |
| 557 EXTENDS=extends_str) | 557 EXTENDS=extends_str) |
| 558 | 558 |
| 559 self._type_comment_emitter.Emit("/// @domName $DOMNAME", | 559 self._type_comment_emitter.Emit("/// @domName $DOMNAME", |
| 560 DOMNAME=self._interface.doc_js_name) | 560 DOMNAME=self._interface.doc_js_name) |
| 561 | 561 |
| 562 if self._backend.HasImplementation(): | 562 if self._backend.HasImplementation(): |
| 563 if not self._interface.id in _merged_html_interfaces: | 563 if not self._interface.id in _merged_html_interfaces: |
| 564 filename = '%sImpl.dart' % self._html_interface_name | 564 filename = '%sImpl.dart' % self._html_interface_name |
| 565 else: | 565 else: |
| 566 filename = '%sImpl.dart' % self._interface.id | 566 filename = '%sImpl_Merged.dart' % self._html_interface_name |
| 567 self._implementation_emitter = self._system._CreateEmitter(filename) | 567 self._implementation_emitter = self._system._CreateEmitter(filename) |
| 568 else: | 568 else: |
| 569 self._implementation_emitter = emitter.Emitter() | 569 self._implementation_emitter = emitter.Emitter() |
| 570 self._backend.SetImplementationEmitter(self._implementation_emitter) | 570 self._backend.SetImplementationEmitter(self._implementation_emitter) |
| 571 self._implementation_members_emitter = self._backend.StartInterface() | 571 self._implementation_members_emitter = self._backend.StartInterface() |
| 572 | 572 |
| 573 for constructor_info in constructors: | 573 for constructor_info in constructors: |
| 574 self._members_emitter.Emit( | 574 self._members_emitter.Emit( |
| 575 '\n' | 575 '\n' |
| 576 ' $CTOR($PARAMS);\n', | 576 ' $CTOR($PARAMS);\n', |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 return HtmlDart2JSClassGenerator(self, interface) | 1222 return HtmlDart2JSClassGenerator(self, interface) |
| 1223 | 1223 |
| 1224 def GenerateLibraries(self, dart_files): | 1224 def GenerateLibraries(self, dart_files): |
| 1225 self._GenerateLibFile( | 1225 self._GenerateLibFile( |
| 1226 'html_dart2js.darttemplate', | 1226 'html_dart2js.darttemplate', |
| 1227 os.path.join(self._output_dir, 'html_dart2js.dart'), | 1227 os.path.join(self._output_dir, 'html_dart2js.dart'), |
| 1228 dart_files) | 1228 dart_files) |
| 1229 | 1229 |
| 1230 def Finish(self): | 1230 def Finish(self): |
| 1231 pass | 1231 pass |
| OLD | NEW |