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

Unified Diff: lib/html/scripts/systemnative.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 | « lib/html/scripts/systemhtml.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemnative.py
diff --git a/lib/html/scripts/systemnative.py b/lib/html/scripts/systemnative.py
index d5d19693a03d5a27b5a5620529e81fa307337dee..f7ca05d1b669e1fefd939f3f6c2dd7809205f425 100644
--- a/lib/html/scripts/systemnative.py
+++ b/lib/html/scripts/systemnative.py
@@ -473,7 +473,6 @@ class DartiumBackend(object):
version = [1]
def GenerateCall(operation, argument_count, checks):
- checks = filter(lambda e: e != 'true', checks)
if checks:
if operation.type.id != 'void':
template = ' if ($CHECKS) {\n return $CALL;\n }\n'
@@ -500,15 +499,14 @@ class DartiumBackend(object):
self._GenerateOperationNativeCallback(operation, operation.arguments[:argument_count], cpp_callback_name)
def GenerateChecksAndCall(operation, argument_count):
- checks = ['!?%s' % name for name in argument_names]
+ checks = []
for i in range(0, argument_count):
argument = operation.arguments[i]
argument_name = argument_names[i]
type = self._DartType(argument.type.id)
if type not in ['dynamic', 'Object']:
- checks[i] = '(%s is %s || %s == null)' % (argument_name, type, argument_name)
- else:
- checks[i] = 'true'
+ checks.append('(%s is %s || %s == null)' % (argument_name, type, argument_name))
+ checks.extend(['!?%s' % name for name in argument_names[argument_count:]])
GenerateCall(operation, argument_count, checks)
# TODO: Optimize the dispatch to avoid repeated checks.
« no previous file with comments | « lib/html/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698