Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: tools/dom/scripts/systemhtml.py

Issue 11887006: Changed @domName annotation in comment to full fledge @DomName annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 os 10 import os
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 def _HasCustomImplementation(self, member_name): 921 def _HasCustomImplementation(self, member_name):
922 member_name = '%s.%s' % (self._interface.doc_js_name, member_name) 922 member_name = '%s.%s' % (self._interface.doc_js_name, member_name)
923 return member_name in _js_custom_members 923 return member_name in _js_custom_members
924 924
925 def _RenamingAnnotation(self, idl_name, member_name): 925 def _RenamingAnnotation(self, idl_name, member_name):
926 if member_name != idl_name: 926 if member_name != idl_name:
927 return "@JSName('%s')\n " % idl_name 927 return "@JSName('%s')\n " % idl_name
928 return '' 928 return ''
929 929
930 def _Annotations(self, idl_type, idl_member_name): 930 def _Annotations(self, idl_type, idl_member_name):
931 out = ''
931 annotations = FindDart2JSAnnotations(idl_type, self._interface.id, 932 annotations = FindDart2JSAnnotations(idl_type, self._interface.id,
932 idl_member_name) 933 idl_member_name)
933 if annotations: 934 if annotations:
934 return '%s\n ' % annotations 935 out = '%s\n ' % annotations
935 return_type = self.SecureOutputType(idl_type) 936 if not AnyConversionAnnotations(idl_type, self._interface.id,
936 native_type = self._NarrowToImplementationType(idl_type) 937 idl_member_name):
937 if native_type != return_type: 938 return_type = self.SecureOutputType(idl_type)
938 return "@Returns('%s') @Creates('%s')\n " % (native_type, native_type) 939 native_type = self._NarrowToImplementationType(idl_type)
939 else: 940 if native_type != return_type:
940 return '' 941 out += "@Returns('%s') @Creates('%s')\n " % (native_type, native_type)
942 return out
941 943
942 def CustomJSMembers(self): 944 def CustomJSMembers(self):
943 return _js_custom_members 945 return _js_custom_members
944 946
945 def _NarrowToImplementationType(self, type_name): 947 def _NarrowToImplementationType(self, type_name):
946 return self._type_registry.TypeInfo(type_name).narrow_dart_type() 948 return self._type_registry.TypeInfo(type_name).narrow_dart_type()
947 949
948 def _NarrowInputType(self, type_name): 950 def _NarrowInputType(self, type_name):
949 return self._NarrowToImplementationType(type_name) 951 return self._NarrowToImplementationType(type_name)
950 952
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 for library_name in libraries: 1049 for library_name in libraries:
1048 self._libraries[library_name] = DartLibrary( 1050 self._libraries[library_name] = DartLibrary(
1049 library_name, template_loader, library_type, output_dir) 1051 library_name, template_loader, library_type, output_dir)
1050 1052
1051 def AddFile(self, basename, library_name, path): 1053 def AddFile(self, basename, library_name, path):
1052 self._libraries[library_name].AddFile(path) 1054 self._libraries[library_name].AddFile(path)
1053 1055
1054 def Emit(self, emitter, auxiliary_dir): 1056 def Emit(self, emitter, auxiliary_dir):
1055 for lib in self._libraries.values(): 1057 for lib in self._libraries.values():
1056 lib.Emit(emitter, auxiliary_dir) 1058 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698