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

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

Issue 10824010: Minor refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/systemnative.py
diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py
index 63fac344b33d550164c4739c57829d0083d8939f..22c3b8355d1a415fa195c52cbc248ffc826a8989 100644
--- a/lib/dom/scripts/systemnative.py
+++ b/lib/dom/scripts/systemnative.py
@@ -683,6 +683,12 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
if ext_attrs.get('CallWith') == 'ScriptExecutionContext':
raises_exceptions = True
requires_script_execution_context = True
+ cpp_arguments = ['context']
+
+ if 'ImplementedBy' in ext_attrs:
+ assert needs_receiver
+ cpp_arguments.append('receiver')
+ self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy'])
if 'NamedConstructor' in ext_attrs:
raises_exceptions = True
@@ -918,13 +924,6 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
' }\n',
INVOCATION=invocation_template)
- if 'ImplementedBy' in attributes:
- arguments.insert(0, 'receiver')
- self._cpp_impl_includes.add('"%s.h"' % attributes['ImplementedBy'])
-
- if attributes.get('CallWith') == 'ScriptExecutionContext':
- arguments.insert(0, 'context')
-
return emitter.Format(invocation_template,
FUNCTION_CALL='%s(%s)' % (function_expression, ', '.join(arguments)))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698