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

Unified Diff: pkg/compiler/lib/src/universe/universe.dart

Issue 908863003: dart2js cps: Handle optional parameters in builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed obsolete TODO Created 5 years, 10 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
Index: pkg/compiler/lib/src/universe/universe.dart
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index a7ddbb03bd91dbda5eafd2af2d45e2c0c780f12d..0b8a40896ac3b4c8e459dc01c42445a6a5840b98 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -593,6 +593,21 @@ class Selector {
return result;
}
+ /// Returns a copy of [compiledArguments] where named arguments occur in
+ /// normalized order.
+ List makeDynamicArgumentsList(List compiledArguments) {
karlklose 2015/02/10 09:07:45 I am not happy with having this helper here. Could
asgerf 2015/02/10 09:37:18 I agree. I put it here because makeArgumentsList
+ assert(compiledArguments.length == argumentCount);
+ List result = [];
+ for (int i=0; i<positionalArgumentCount; i++) {
karlklose 2015/02/10 09:07:45 Space around binary operators.
asgerf 2015/02/10 09:37:18 Done.
+ result.add(compiledArguments[i]);
+ }
+ for (String argName in getOrderedNamedArguments()) {
+ int nameIndex = namedArguments.indexOf(argName);
+ int translatedIndex = positionalArgumentCount + nameIndex;
+ result.add(compiledArguments[translatedIndex]);
+ }
+ return result;
+ }
/**
* Fills [list] with the arguments in the order expected by

Powered by Google App Engine
This is Rietveld 408576698