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

Unified Diff: lib/dom/src/native_DOMImplementation.dart

Issue 10008089: Some additional Utils functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor amendments. Created 8 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
« 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/src/native_DOMImplementation.dart
diff --git a/lib/dom/src/native_DOMImplementation.dart b/lib/dom/src/native_DOMImplementation.dart
index aa0a3ccca2aebd3ef3eef8d7bcc8f9f7e0b7c99f..3268e66ae3935c02d81463e5c3437f0f8f886c37 100644
--- a/lib/dom/src/native_DOMImplementation.dart
+++ b/lib/dom/src/native_DOMImplementation.dart
@@ -11,6 +11,22 @@ class Utils {
return result;
}
+ static List convertMapToList(Map map) {
+ List result = [];
+ map.forEach((k, v) => result.addAll([k, v]));
+ return result;
+ }
+
+ static void populateMap(Map result, List list) {
+ for (int i = 0; i < list.length; i += 2) {
+ result[list[i]] = list[i + 1];
+ }
+ }
+
+ static bool isMap(obj) => obj is Map;
+
+ static Map createMap() => {};
+
static makeNotImplementedException(String fileName, int lineNo) {
return new UnsupportedOperationException('[info: $fileName:$lineNo]');
}
« 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