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

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

Issue 15960004: Revert to ? presence checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « sdk/lib/web_gl/dart2js/web_gl_dart2js.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/htmldartgenerator.py
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 6635a2a8a39c2f59794bf9abfae6978c412d7bfa..266bc20c7a25d3724b42301e1daacc64d5ff643a 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -234,30 +234,24 @@ class HtmlDartGenerator(object):
generate_call(stmts_emitter, call_emitter,
version[0], signature_index, argument_count)
- def IsDartTypeNullable(type_signature):
- return type_signature not in ['int', 'double', 'num', 'bool']
-
def GenerateChecksAndCall(signature_index, argument_count):
checks = []
for i in range(0, argument_count):
argument = signatures[signature_index][i]
parameter_name = parameter_names[i]
test_type = self._DartType(argument.type.id)
- nullable = argument.type.nullable
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 not nullable and not IsDartTypeNullable(test_type):
+ else:
for signature in signatures:
if (len(signature) <= i or signature[i].id not in
parameter_name.split('_OR_')):
- checks.append('%s != null' % parameter_name)
+ checks.append('?%s' % parameter_name)
break
# There can be multiple presence checks. We need them all since a later
« no previous file with comments | « sdk/lib/web_gl/dart2js/web_gl_dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698