Index: tools/dom/scripts/systemnative.py |
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py |
index 60ab06215c8377f94fc2fec50749f8e09cfb3ace..fc27037341ed0f859b0d0c9a96e3b7696a1cbee5 100644 |
--- a/tools/dom/scripts/systemnative.py |
+++ b/tools/dom/scripts/systemnative.py |
@@ -732,10 +732,22 @@ class DartiumBackend(HtmlDartGenerator): |
argument_expression_template, type, cls, function = \ |
type_info.to_native_info(argument, self._interface.id) |
- if (isinstance(argument, IDLArgument) and ( |
- (IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument)) or |
- (argument.ext_attrs.get('Default') == 'NullString') or |
- _IsOptionalStringArgumentInInitEventMethod(self._interface, node, argument))): |
+ def AllowsNull(): |
+ assert argument.ext_attrs.get('TreatNullAs', 'NullString') == 'NullString' |
+ if argument.ext_attrs.get('TreatNullAs') == 'NullString': |
+ return True |
+ |
+ if isinstance(argument, IDLArgument): |
+ if IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument): |
+ return True |
+ if argument.ext_attrs.get('Default') == 'NullString': |
+ return True |
+ if _IsOptionalStringArgumentInInitEventMethod(self._interface, node, argument): |
+ return True |
+ |
+ return False |
+ |
+ if AllowsNull(): |
function += 'WithNullCheck' |
argument_name = DartDomNameOfAttribute(argument) |