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

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

Issue 11027033: Move Dart type narrowing to TypeRegistry. (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
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | 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 6fe6ab7f91b2287e214b93c5be126574ba7309cd..6bcf371517853e91f1d93bcaebb7ecc63b7939f8 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -1028,25 +1028,10 @@ class Dart2JSBackend(object):
if element_type and requires_indexer: return True
return False
- def _ShouldNarrowToImplementationType(self, type_name):
- # TODO(sra): Move into the 'system' and cache the result.
- do_not_narrow = ['DOMStringList', 'DOMStringMap', 'EventListener',
- 'IDBAny', 'IDBKey', 'MediaQueryListListener', 'List<Node>',
- 'NodeList']
- if type_name in do_not_narrow:
- return False
- if self._database.HasInterface(type_name):
- interface = self._database.GetInterface(type_name)
- # Callbacks are typedef functions so don't have a class.
- return 'Callback' not in interface.ext_attrs
- return False
-
def _NarrowToImplementationType(self, type_name):
if type_name == 'Dynamic':
return type_name
- if self._ShouldNarrowToImplementationType(type_name):
- return self._ImplClassName(self._DartType(type_name))
- return self._DartType(type_name)
+ return self._type_registry.TypeInfo(type_name).narrow_dart_type()
def _NarrowInputType(self, type_name):
return self._NarrowToImplementationType(type_name)
« lib/html/scripts/generator.py ('K') | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698