Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: tools/dom/scripts/systemnative.py

Issue 14190019: Allow null assignments if there is a corresponding marker. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/input_element_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « tests/html/input_element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698