| Index: tools/dom/scripts/htmldartgenerator.py
|
| diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
|
| index 0dc105415817ab79c08e15ece11bbb821d4f9215..01ef3d74dddd18c6db9b33ceff3fecd9ef2a1581 100644
|
| --- a/tools/dom/scripts/htmldartgenerator.py
|
| +++ b/tools/dom/scripts/htmldartgenerator.py
|
| @@ -201,6 +201,7 @@ class HtmlDartGenerator(object):
|
| signatures,
|
| is_void,
|
| parameter_names,
|
| + number_of_required_in_dart,
|
| declaration,
|
| generate_call,
|
| is_optional,
|
| @@ -245,6 +246,9 @@ class HtmlDartGenerator(object):
|
| elif not can_omit_type_check(test_type, i):
|
| checks.append('(%s is %s || %s == null)' % (
|
| parameter_name, test_type, parameter_name))
|
| + elif i > number_of_required_in_dart:
|
| + checks.append('?%s' % parameter_name)
|
| +
|
| # 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:]])
|
| @@ -300,6 +304,7 @@ class HtmlDartGenerator(object):
|
| def _GenerateDispatcherBody(self,
|
| operations,
|
| parameter_names,
|
| + number_of_required_in_dart,
|
| declaration,
|
| generate_call,
|
| is_optional,
|
| @@ -318,6 +323,7 @@ class HtmlDartGenerator(object):
|
| [operation.arguments for operation in operations],
|
| operations[0].type.id == 'void',
|
| parameter_names,
|
| + number_of_required_in_dart,
|
| declaration,
|
| GenerateCall,
|
| IsOptional,
|
| @@ -431,6 +437,7 @@ class HtmlDartGenerator(object):
|
| constructor_info.idl_args,
|
| False,
|
| [info.name for info in constructor_info.param_infos],
|
| + constructor_info.NumberOfRequiredInDart(),
|
| emitter.Format('$(METADATA)$FACTORY_KEYWORD $CTOR($PARAMS)',
|
| FACTORY_KEYWORD=('factory' if not custom_factory_ctr else
|
| 'static %s' % constructor_full_name),
|
|
|