Chromium Code Reviews| 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. |