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

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

Issue 11338033: Do not emit is dynamic/Object checks. (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/dartium/html_dartium.dart ('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 5c8ce40c9a61f7e3e36b4625504c078da31d0ba0..d5d19693a03d5a27b5a5620529e81fa307337dee 100644
--- a/lib/html/scripts/systemnative.py
+++ b/lib/html/scripts/systemnative.py
@@ -473,6 +473,7 @@ class DartiumBackend(object):
version = [1]
def GenerateCall(operation, argument_count, checks):
+ checks = filter(lambda e: e != 'true', checks)
podivilov 2012/10/30 13:28:00 This looks sketchy. Please don't add those checks
Anton Muhin 2012/10/30 13:29:35 a) that's the easier for the current solution when
podivilov 2012/10/30 13:32:58 If I remember correctly, dart2js code was copy-pas
if checks:
if operation.type.id != 'void':
template = ' if ($CHECKS) {\n return $CALL;\n }\n'
@@ -503,8 +504,11 @@ class DartiumBackend(object):
for i in range(0, argument_count):
argument = operation.arguments[i]
argument_name = argument_names[i]
- checks[i] = '(%s is %s || %s == null)' % (
- argument_name, self._DartType(argument.type.id), argument_name)
+ 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'
GenerateCall(operation, argument_count, checks)
# TODO: Optimize the dispatch to avoid repeated checks.
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698