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

Unified Diff: lib/compiler/implementation/js_backend/namer.dart

Issue 10991034: Order the parameters of a function at the definition site. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/compiler/implementation/js_backend/emitter.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/js_backend/namer.dart
===================================================================
--- lib/compiler/implementation/js_backend/namer.dart (revision 12903)
+++ lib/compiler/implementation/js_backend/namer.dart (working copy)
@@ -110,13 +110,12 @@
'${privateName(lib, name)}\$${signature.parameterCount}';
if (!signature.optionalParametersAreNamed) {
return methodName;
- } else {
- StringBuffer suffix = new StringBuffer();
- signature.forEachOptionalParameter((Element element) {
- String jsName = JsNames.getValid(element.name.slowToString());
- suffix.add('\$$jsName');
+ } else if (!signature.optionalParameters.isEmpty()) {
+ StringBuffer buffer = new StringBuffer();
+ signature.orderedOptionalParameters.forEach((Element element) {
+ buffer.add('\$${JsNames.getValid(element.name.slowToString())}');
});
- return '$methodName$suffix';
+ return '$methodName$buffer';
}
}
« no previous file with comments | « lib/compiler/implementation/js_backend/emitter.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698