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

Unified Diff: lib/html/scripts/systemhtml.py

Issue 11342046: Do not pass tautology predicates into check list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | lib/html/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemhtml.py
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index dd776674c531d9dbacbe9731e2ca9945cc050d98..44553c421cc54213e73ba3e48cf7fc9eb6de8906 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -915,7 +915,6 @@ class Dart2JSBackend(object):
temp_version = [0]
def GenerateCall(operation, argument_count, checks):
- checks = filter(lambda e: e != 'true', checks)
if checks:
(stmts_emitter, call_emitter) = body.Emit(
' if ($CHECKS) {\n$!STMTS$!CALL }\n',
@@ -981,18 +980,17 @@ class Dart2JSBackend(object):
NATIVE=info.declared_name)
def GenerateChecksAndCall(operation, argument_count):
- checks = ['!?%s' % name for name in parameter_names]
+ checks = []
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] = '?%s' % parameter_name
- elif test_type == parameter_types[i]:
- checks[i] = 'true'
- else:
- checks[i] = '(%s is %s || %s == null)' % (
- parameter_name, test_type, parameter_name)
+ checks.append('?%s' % parameter_name)
+ elif test_type != parameter_types[i]:
+ checks.append('(%s is %s || %s == null)' % (
+ parameter_name, test_type, parameter_name))
+ checks.extend(['!?%s' % name for name in parameter_names[argument_count:]])
# 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)
« no previous file with comments | « no previous file | lib/html/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698