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

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

Issue 10779013: Simplify head emission a bit. (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 add05bdc11cfeea3f510259ac6ca1fb7e51f06cc..830cf14f58af9028af558ca57f01a08bae21268b 100644
--- a/lib/dom/scripts/systemnative.py
+++ b/lib/dom/scripts/systemnative.py
@@ -790,21 +790,21 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
def _GenerateNativeCallback(self, callback_name, parameter_definitions,
needs_receiver, invocation, raises_exceptions, runtime_check=None):
- head = parameter_definitions
+ head_emitter = emitter.Emitter()
if needs_receiver:
- head = emitter.Format(
- ' $WEBCORE_CLASS_NAME* receiver = DartDOMWrapper::receiver< $WEBCORE_CLASS_NAME >(args);\n'
- '$HEAD\n',
- WEBCORE_CLASS_NAME=self._interface_type_info.native_type(),
- HEAD=head)
+ head_emitter.Emit(
+ ' $WEBCORE_CLASS_NAME* receiver = DartDOMWrapper::receiver< $WEBCORE_CLASS_NAME >(args);\n',
+ WEBCORE_CLASS_NAME=self._interface_type_info.native_type())
if runtime_check:
- head = emitter.Format(
- '$RUNTIME_CHECK\n'
- '$HEAD\n',
podivilov 2012/07/16 15:43:16 Is it ok to change the order?
Anton Muhin 2012/07/16 15:46:45 That should be, but let me lift it up to keep the
- RUNTIME_CHECK=runtime_check,
- HEAD=head)
+ head_emitter.Emit(
podivilov 2012/07/16 15:43:16 Maybe just emit(runtime_check)?
Anton Muhin 2012/07/16 15:46:45 Missing trailing \n, let's keep it as is for now.
+ '$RUNTIME_CHECK\n',
+ RUNTIME_CHECK=runtime_check)
+
+ head_emitter.Emit(
+ '$PARAMETE_DEFINITIONS\n',
+ PARAMETE_DEFINITIONS=parameter_definitions)
body = emitter.Format(
' {\n'
@@ -812,7 +812,7 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
'$INVOCATION'
' return;\n'
' }\n',
- HEAD=head,
+ HEAD=head_emitter.Fragments(),
INVOCATION=invocation)
if raises_exceptions:
« 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