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

Unified Diff: sdk/lib/_internal/pub/lib/src/utils.dart

Issue 1106713003: Support defining environment constants for dart2js via the command-line. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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: sdk/lib/_internal/pub/lib/src/utils.dart
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
index 14d81a67a4138ea4e2c6aac75429c1a6cc05a132..c51202c637e2c6f6b07040351c6b5767cc7e1aeb 100644
--- a/sdk/lib/_internal/pub/lib/src/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -371,6 +371,20 @@ Future<Map> mapFromIterableAsync(Iterable iter, {key(element),
})).then((_) => map);
}
+/// Returns a new map with all values in both [map1] and [map2].
Bob Nystrom 2015/04/24 21:33:09 "values" -> "entries".
nweiz 2015/04/24 21:38:06 Done.
+///
+/// If there are conflicting keys, [map2]'s value wins.
Bob Nystrom 2015/04/24 21:33:10 "conflicting" -> "overlapping".
nweiz 2015/04/24 21:38:06 Done.
+Map mergeMaps(Map map1, Map map2) {
+ var result = {};
Bob Nystrom 2015/04/24 21:33:10 result.addAll(map1); result.addAll(map2);
nweiz 2015/04/24 21:38:06 Done.
+ map1.forEach((key, value) {
+ result[key] = value;
+ });
+ map2.forEach((key, value) {
+ result[key] = value;
+ });
+ return result;
+}
+
/// Returns the transitive closure of [graph].
///
/// This assumes [graph] represents a graph with a vertex for each key and an

Powered by Google App Engine
This is Rietveld 408576698