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

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

Issue 2242203002: record that Gamepad.buttons creates GamepadButtons (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add test Created 4 years, 4 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 | « tools/dom/scripts/htmldartgenerator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/systemhtml.py
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 2208f229ddaa6e44984bec01af7f5c8b206aac84..4fc7e6ef772e08d4c1f5fd78f8fcd090a2266f70 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -838,7 +838,7 @@ class Dart2JSBackend(HtmlDartGenerator):
break
return has_indexed_getter
- def AddIndexer(self, element_type):
+ def AddIndexer(self, element_type, nullable):
"""Adds all the methods required to complete implementation of List."""
# We would like to simply inherit the implementation of everything except
# length, [], and maybe []=. It is possible to extend from a base
@@ -861,8 +861,8 @@ class Dart2JSBackend(HtmlDartGenerator):
has_indexed_getter = self.HasIndexedGetter()
if has_indexed_getter:
- indexed_getter = ('JS("%s", "#[#]", this, index)' %
- self.SecureOutputType(element_type));
+ indexed_getter = ('JS("%s%s", "#[#]", this, index)' %
+ (self.SecureOutputType(element_type), "|Null" if nullable else ""));
elif any(op.id == 'getItem' for op in self._interface.operations):
indexed_getter = 'this.getItem(index)'
elif any(op.id == 'item' for op in self._interface.operations):
@@ -894,7 +894,7 @@ class Dart2JSBackend(HtmlDartGenerator):
' }\n',
TYPE=self._NarrowInputType(element_type))
- self.EmitListMixin(self._DartType(element_type))
+ self.EmitListMixin(self._DartType(element_type), nullable)
def EmitAttribute(self, attribute, html_name, read_only):
if self._HasCustomImplementation(attribute.id):
« 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