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

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

Issue 2879663002: dom: Recognize __getter__ indexers (Closed)
Patch Set: Created 3 years, 7 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
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 logging 10 import logging
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id) 867 self._members_emitter.Emit('\n // From $WHERE\n', WHERE=interface.id)
868 868
869 def HasIndexedGetter(self): 869 def HasIndexedGetter(self):
870 ext_attrs = self._interface.ext_attrs 870 ext_attrs = self._interface.ext_attrs
871 has_indexed_getter = 'CustomIndexedGetter' in ext_attrs 871 has_indexed_getter = 'CustomIndexedGetter' in ext_attrs
872 for operation in self._interface.operations: 872 for operation in self._interface.operations:
873 if operation.id == 'item' and 'getter' in operation.specials \ 873 if operation.id == 'item' and 'getter' in operation.specials \
874 and not self._OperationRequiresConversions(operation): 874 and not self._OperationRequiresConversions(operation):
875 has_indexed_getter = True 875 has_indexed_getter = True
876 break 876 break
877 if operation.id == '__getter__' and 'getter' in operation.specials \
878 and not self._OperationRequiresConversions(operation):
879 has_indexed_getter = True
880 break
877 return has_indexed_getter 881 return has_indexed_getter
878 882
879 def AddIndexer(self, element_type, nullable): 883 def AddIndexer(self, element_type, nullable):
880 """Adds all the methods required to complete implementation of List.""" 884 """Adds all the methods required to complete implementation of List."""
881 # We would like to simply inherit the implementation of everything except 885 # We would like to simply inherit the implementation of everything except
882 # length, [], and maybe []=. It is possible to extend from a base 886 # length, [], and maybe []=. It is possible to extend from a base
883 # array implementation class only when there is no other implementation 887 # array implementation class only when there is no other implementation
884 # inheritance. There might be no implementation inheritance other than 888 # inheritance. There might be no implementation inheritance other than
885 # DOMBaseWrapper for many classes, but there might be some where the 889 # DOMBaseWrapper for many classes, but there might be some where the
886 # array-ness is introduced by a non-root interface: 890 # array-ness is introduced by a non-root interface:
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 1388
1385 def AddFile(self, basename, library_name, path): 1389 def AddFile(self, basename, library_name, path):
1386 self._libraries[library_name].AddFile(path) 1390 self._libraries[library_name].AddFile(path)
1387 1391
1388 def AddTypeEntry(self, library_name, idl_name, dart_name): 1392 def AddTypeEntry(self, library_name, idl_name, dart_name):
1389 self._libraries[library_name].AddTypeEntry(idl_name, dart_name) 1393 self._libraries[library_name].AddTypeEntry(idl_name, dart_name)
1390 1394
1391 def Emit(self, emitter, auxiliary_dir): 1395 def Emit(self, emitter, auxiliary_dir):
1392 for lib in self._libraries.values(): 1396 for lib in self._libraries.values():
1393 lib.Emit(emitter, auxiliary_dir) 1397 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« tools/dom/scripts/htmlrenamer.py ('K') | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698