| Index: lib/html/scripts/systemhtml.py
|
| diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
|
| index 2abfed2d85d1edecf4a0c69e84a2ab30b616046f..93c852e51cb8d2621b4fc2a37a86dac5c2454d2f 100644
|
| --- a/lib/html/scripts/systemhtml.py
|
| +++ b/lib/html/scripts/systemhtml.py
|
| @@ -1076,7 +1076,7 @@ class HtmlDart2JSClassGenerator(Dart2JSInterfaceGenerator):
|
| ' }\n',
|
| TYPE=return_type,
|
| HTML_NAME=html_name,
|
| - PARAMS=info.ParametersImplementationDeclaration(InputType, '_default'))
|
| + PARAMS=info.ParametersImplementationDeclaration(InputType))
|
|
|
| parameter_names = [param_info.name for param_info in info.param_infos]
|
| parameter_types = [InputType(param_info.dart_type)
|
| @@ -1153,19 +1153,19 @@ class HtmlDart2JSClassGenerator(Dart2JSInterfaceGenerator):
|
| NATIVE=info.declared_name)
|
|
|
| def GenerateChecksAndCall(operation, argument_count):
|
| - checks = ['_default == %s' % name for name in parameter_names]
|
| + checks = ['!?%s' % name for name in parameter_names]
|
| for i in range(0, argument_count):
|
| argument = operation.arguments[i]
|
| parameter_name = parameter_names[i]
|
| test_type = self._DartType(argument.type.id)
|
| if test_type in ['Dynamic', 'Object']:
|
| - checks[i] = '_default != %s' % parameter_name
|
| + checks[i] = '?%s' % parameter_name
|
| elif test_type == parameter_types[i]:
|
| checks[i] = 'true'
|
| else:
|
| - checks[i] = '(%s is %s || %s == null)' % (
|
| + checks[i] = '(%s is %s || %s === null)' % (
|
| parameter_name, test_type, parameter_name)
|
| - # There can be multiple _default checks. We need them all since a later
|
| + # There can be multiple presence checks. We need them all since a later
|
| # optional argument could have been passed by name, leaving 'holes'.
|
| GenerateCall(operation, argument_count, checks)
|
|
|
| @@ -1184,7 +1184,7 @@ class HtmlDart2JSClassGenerator(Dart2JSInterfaceGenerator):
|
| argument_count = len(operation.arguments)
|
| for position, argument in list(enumerate(operation.arguments))[::-1]:
|
| if self._IsOptional(operation, argument):
|
| - check = '_default != %s' % parameter_names[position]
|
| + check = '?%s' % parameter_names[position]
|
| GenerateCall(operation, position + 1, [check])
|
| argument_count = position
|
| GenerateCall(operation, argument_count, [])
|
|
|