| 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 659 |
| 660 def AddSecondaryOperation(self, interface, info): | 660 def AddSecondaryOperation(self, interface, info): |
| 661 self._backend.SecondaryContext(interface) | 661 self._backend.SecondaryContext(interface) |
| 662 self.AddOperation(info, True) | 662 self.AddOperation(info, True) |
| 663 | 663 |
| 664 def FinishInterface(self): | 664 def FinishInterface(self): |
| 665 self._backend.FinishInterface() | 665 self._backend.FinishInterface() |
| 666 | 666 |
| 667 def AddConstant(self, constant): | 667 def AddConstant(self, constant): |
| 668 type = TypeOrNothing(self._DartType(constant.type.id), constant.type.id) | 668 type = TypeOrNothing(self._DartType(constant.type.id), constant.type.id) |
| 669 self._members_emitter.Emit('\n static final $TYPE$NAME = $VALUE;\n', | 669 self._members_emitter.Emit('\n static const $TYPE$NAME = $VALUE;\n', |
| 670 NAME=constant.id, | 670 NAME=constant.id, |
| 671 TYPE=type, | 671 TYPE=type, |
| 672 VALUE=constant.value) | 672 VALUE=constant.value) |
| 673 self._backend.AddConstant(constant) | 673 self._backend.AddConstant(constant) |
| 674 | 674 |
| 675 def _GenerateEvents(self): | 675 def _GenerateEvents(self): |
| 676 emit_events, event_attrs = self._shared.GetEventAttributes(self._interface) | 676 emit_events, event_attrs = self._shared.GetEventAttributes(self._interface) |
| 677 if not emit_events: | 677 if not emit_events: |
| 678 return | 678 return |
| 679 | 679 |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 return HtmlDart2JSClassGenerator(self, interface) | 1225 return HtmlDart2JSClassGenerator(self, interface) |
| 1226 | 1226 |
| 1227 def GenerateLibraries(self, dart_files): | 1227 def GenerateLibraries(self, dart_files): |
| 1228 self._GenerateLibFile( | 1228 self._GenerateLibFile( |
| 1229 'html_dart2js.darttemplate', | 1229 'html_dart2js.darttemplate', |
| 1230 os.path.join(self._output_dir, 'html_dart2js.dart'), | 1230 os.path.join(self._output_dir, 'html_dart2js.dart'), |
| 1231 dart_files) | 1231 dart_files) |
| 1232 | 1232 |
| 1233 def Finish(self): | 1233 def Finish(self): |
| 1234 pass | 1234 pass |
| OLD | NEW |