Index: tools/dom/scripts/htmldartgenerator.py |
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py |
index 0dc105415817ab79c08e15ece11bbb821d4f9215..87fed8bd9b20dc2f4bb7662c694534fc26bf751d 100644 |
--- a/tools/dom/scripts/htmldartgenerator.py |
+++ b/tools/dom/scripts/htmldartgenerator.py |
@@ -240,11 +240,19 @@ class HtmlDartGenerator(object): |
argument = signatures[signature_index][i] |
parameter_name = parameter_names[i] |
test_type = self._DartType(argument.type.id) |
+ |
if test_type in ['dynamic', 'Object']: |
checks.append('?%s' % parameter_name) |
elif not can_omit_type_check(test_type, i): |
checks.append('(%s is %s || %s == null)' % ( |
parameter_name, test_type, parameter_name)) |
+ |
+ if can_omit_type_check(test_type, i): |
Anton Muhin
2013/05/14 06:17:34
why if, looks like it should be rather else:, see
|
+ for signature in signatures: |
+ if argument not in signature: |
Anton Muhin
2013/05/14 06:17:34
this check looks incorrect: you most probably want
Andrei Mouravski
2013/05/21 09:38:49
Done.
This check wasn't here before because... no
|
+ checks.append('%s != null' % parameter_name) |
+ break |
+ |
# There can be multiple presence checks. We need them all since a later |
# optional argument could have been passed by name, leaving 'holes'. |
checks.extend(['!?%s' % name for name in parameter_names[argument_count:]]) |