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

Unified Diff: tools/dom/scripts/htmldartgenerator.py

Issue 2875773003: Roll 50: Updated for push to origin/master. (Closed)
Patch Set: Roll 50: Updated to latest 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 side-by-side diff with in-line comments
Download patch
Index: tools/dom/scripts/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 62056e7372a046fda358ba223c8aad680b8e6b09..53be964e59dea1aabe6ff74ca98d441f7afce4a8 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -393,11 +393,13 @@ class HtmlDartGenerator(object):
generate_call(stmts_emitter, call_emitter,
version[0], signature_index, argument_count)
+ def IsTypeChecking(interface_argument):
+ return 'LegacyInterfaceTypeChecking' in interface_argument.ext_attrs or \
+ self._database.HasInterface(interface_argument.id)
+
def GenerateChecksAndCall(signature_index, argument_count):
checks = []
- typechecked_interface = \
- ('TypeChecking' in self._interface.ext_attrs) and \
- ('Interface' in self._interface.ext_attrs['TypeChecking'])
+ typechecked_interface = IsTypeChecking(self._interface)
for i in reversed(range(0, argument_count)):
argument = signatures[signature_index][i]
@@ -408,9 +410,7 @@ class HtmlDartGenerator(object):
if test_type in ['dynamic', 'Object']:
checks.append('%s != null' % parameter_name)
elif not can_omit_type_check(test_type, i):
- typechecked = typechecked_interface or \
- ('TypeChecking' in argument.ext_attrs) and \
- ('Interface' in argument.ext_attrs['TypeChecking'])
+ typechecked = typechecked_interface or IsTypeChecking(argument)
converts_null = \
('TreatNullAs' in argument.ext_attrs) or \
(argument.default_value is not None) or \
@@ -541,9 +541,10 @@ class HtmlDartGenerator(object):
def _AddConstructor(self,
constructor_info, factory_name, factory_constructor_name):
- # Hack to ignore the Image constructor used by JavaScript.
+ # Hack to ignore the constructor used by JavaScript.
if ((self._interface.id == 'HTMLImageElement' or
self._interface.id == 'Blob' or
+ self._interface.id == 'TouchEvent' or
self._interface.id == 'DOMException')
and not constructor_info.pure_dart_constructor):
return

Powered by Google App Engine
This is Rietveld 408576698