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

Unified Diff: lib/html/scripts/systemhtml.py

Issue 11118025: Extract common logic from Backend.BaseClassName(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/html/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemhtml.py
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index a163caf907e209e99f4b5dc687839521526601d0..1dd62145629d8f233179df69b45d251bec19d82e 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -312,9 +312,17 @@ class HtmlDartInterfaceGenerator(object):
DOMNAME=self._interface.doc_js_name)
implementation_emitter = self._ImplementationEmitter()
- base_class = self._backend.BaseClassName()
- interface_type_info = self._type_registry.TypeInfo(self._interface.id)
- implemented_interfaces = [interface_type_info.interface_name()] +\
+
+ base_class = self._backend.RootClassName()
+ if self._interface.parents:
+ supertype = self._interface.parents[0].type.id
+ if not IsDartCollectionType(supertype) and not IsPureInterface(supertype):
+ type_info = self._type_registry.TypeInfo(supertype)
+ if type_info.merged_into() and self._backend.ImplementsMergedMembers():
+ type_info = self._type_registry.TypeInfo(type_info.merged_into())
+ base_class = type_info.implementation_name()
+
+ implemented_interfaces = [interface_name] +\
self._backend.AdditionalImplementedInterfaces()
self._implementation_members_emitter = implementation_emitter.Emit(
self._backend.ImplementationTemplate(),
@@ -591,19 +599,8 @@ class Dart2JSBackend(object):
def GenerateCallback(self, info):
pass
- def BaseClassName(self):
- if not self._interface.parents:
- return None
- supertype = self._interface.parents[0].type.id
- if IsDartCollectionType(supertype):
- # List methods are injected in AddIndexer.
- return None
- if IsPureInterface(supertype):
- return None
- type_info = self._type_registry.TypeInfo(supertype)
- if type_info.merged_into():
- type_info = self._type_registry.TypeInfo(type_info.merged_into())
- return type_info.implementation_name()
+ def RootClassName(self):
+ return None
def AdditionalImplementedInterfaces(self):
# TODO: Include all implemented interfaces, including other Lists.
« no previous file with comments | « no previous file | lib/html/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698