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

Unified Diff: tools/dom/scripts/htmldartgenerator.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/generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 8397b8f74e48e8c2ee4b1ec72c617f2175814deb..2d5e52d12456adf936a5f64aea243ed4081d5cb3 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -83,7 +83,8 @@ class HtmlDartGenerator(object):
element_type = None
requires_indexer = False
if self._interface_type_info.list_item_type():
- self.AddIndexer(self._interface_type_info.list_item_type())
+ self.AddIndexer(self._interface_type_info.list_item_type(),
+ self._interface_type_info.list_item_type_nullable())
else:
for parent in self._database.Hierarchy(self._interface):
if parent == self._interface:
@@ -759,7 +760,7 @@ class HtmlDartGenerator(object):
NAME=method_name,
PARAMS=operation.ParametersAsDeclaration(self._DartType))
- def EmitListMixin(self, element_name):
+ def EmitListMixin(self, element_name, nullable):
# TODO(sra): Use separate mixins for mutable implementations of List<T>.
# TODO(sra): Use separate mixins for typed array implementations of List<T>.
template_file = 'immutable_list_mixin.darttemplate'
@@ -795,7 +796,12 @@ class HtmlDartGenerator(object):
'DEFINE_LENGTH_SETTER': not has_length_setter,
'USE_NATIVE_INDEXED_GETTER': _HasNativeIndexedGetter(self) or _HasExplicitIndexedGetter(self),
})
- self._members_emitter.Emit(template, E=element_name, GETTER=getter_name)
+ if nullable:
+ element_js = element_name + "|Null"
+ else:
+ element_js = element_name
+ self._members_emitter.Emit(template, E=element_name, EJS=element_js,
+ GETTER=getter_name)
def SecureOutputType(self, type_name, is_dart_type=False,
can_narrow_type=False):
@@ -870,7 +876,7 @@ class HtmlDartGenerator(object):
else:
param_type = self._NarrowInputType(arg.type.id)
# Verified by argument checking on entry to the dispatcher.
-
+
verified_type = self._InputType(
info.param_infos[position].type_id, info)
# The native method does not need an argument type if we know the type.
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698