| 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 monitored | 10 import monitored |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 '\n }' | 815 '\n }' |
| 816 '\n', | 816 '\n', |
| 817 HTML_NAME=html_name, | 817 HTML_NAME=html_name, |
| 818 NAME=attr.id, | 818 NAME=attr.id, |
| 819 TYPE=self._NarrowInputType(attr.type.id)) | 819 TYPE=self._NarrowInputType(attr.type.id)) |
| 820 | 820 |
| 821 def _AddConvertingGetter(self, attr, html_name, conversion): | 821 def _AddConvertingGetter(self, attr, html_name, conversion): |
| 822 self._members_emitter.Emit( | 822 self._members_emitter.Emit( |
| 823 '\n $RETURN_TYPE get $HTML_NAME => $CONVERT(this._$(HTML_NAME));' | 823 '\n $RETURN_TYPE get $HTML_NAME => $CONVERT(this._$(HTML_NAME));' |
| 824 "\n @JSName('$NAME')" | 824 "\n @JSName('$NAME')" |
| 825 '\n $(ANNOTATIONS)final $NATIVE_TYPE _$HTML_NAME;' | 825 '\n $(ANNOTATIONS)$NATIVE_TYPE get _$HTML_NAME => ' |
| 826 'JS("", "#.$NAME", this);' |
| 826 '\n', | 827 '\n', |
| 827 ANNOTATIONS=self._Annotations(attr.type.id, html_name), | 828 ANNOTATIONS=self._Annotations(attr.type.id, html_name), |
| 828 CONVERT=conversion.function_name, | 829 CONVERT=conversion.function_name, |
| 829 HTML_NAME=html_name, | 830 HTML_NAME=html_name, |
| 830 NAME=attr.id, | 831 NAME=attr.id, |
| 831 RETURN_TYPE=conversion.output_type, | 832 RETURN_TYPE=conversion.output_type, |
| 832 NATIVE_TYPE=conversion.input_type) | 833 NATIVE_TYPE=conversion.input_type) |
| 833 | 834 |
| 834 def _AddConvertingSetter(self, attr, html_name, conversion): | 835 def _AddConvertingSetter(self, attr, html_name, conversion): |
| 835 self._members_emitter.Emit( | 836 self._members_emitter.Emit( |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 for library_name in libraries: | 1136 for library_name in libraries: |
| 1136 self._libraries[library_name] = DartLibrary( | 1137 self._libraries[library_name] = DartLibrary( |
| 1137 library_name, template_loader, library_type, output_dir) | 1138 library_name, template_loader, library_type, output_dir) |
| 1138 | 1139 |
| 1139 def AddFile(self, basename, library_name, path): | 1140 def AddFile(self, basename, library_name, path): |
| 1140 self._libraries[library_name].AddFile(path) | 1141 self._libraries[library_name].AddFile(path) |
| 1141 | 1142 |
| 1142 def Emit(self, emitter, auxiliary_dir): | 1143 def Emit(self, emitter, auxiliary_dir): |
| 1143 for lib in self._libraries.values(): | 1144 for lib in self._libraries.values(): |
| 1144 lib.Emit(emitter, auxiliary_dir) | 1145 lib.Emit(emitter, auxiliary_dir) |
| OLD | NEW |