Chromium Code Reviews| Index: tools/dom/scripts/htmldartgenerator.py |
| diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py |
| index 0dc105415817ab79c08e15ece11bbb821d4f9215..571e55e2b1563d6ac6cb97ccbb49ea3099dd3372 100644 |
| --- a/tools/dom/scripts/htmldartgenerator.py |
| +++ b/tools/dom/scripts/htmldartgenerator.py |
| @@ -240,11 +240,22 @@ class HtmlDartGenerator(object): |
| argument = signatures[signature_index][i] |
| parameter_name = parameter_names[i] |
| test_type = self._DartType(argument.type.id) |
| + nullable = False or argument.type.nullable |
|
Anton Muhin
2013/05/21 13:24:08
False or?
Andrei Mouravski
2013/05/21 18:39:14
I am not a smart person... :-)
On 2013/05/21 13:
|
| + |
| if test_type in ['dynamic', 'Object']: |
| checks.append('?%s' % parameter_name) |
| elif not can_omit_type_check(test_type, i): |
| + nullable = True |
| checks.append('(%s is %s || %s == null)' % ( |
| parameter_name, test_type, parameter_name)) |
| + |
| + if nullable is False: |
|
Anton Muhin
2013/05/21 13:24:08
nit: if not nullable
Andrei Mouravski
2013/05/21 18:39:14
Done.
|
| + for signature in signatures: |
| + if (argument not in signature or (len(signature) > i and |
|
Anton Muhin
2013/05/21 13:24:08
why still argument not in signagture check
Andrei Mouravski
2013/05/21 18:39:14
Done.
|
| + signature[i] != argument)): |
| + 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:]]) |