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

Unified Diff: tools/dom/src/AttributeMap.dart

Issue 15263004: Adding isNotEmpty property to collection and string. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix template generation Created 7 years, 7 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 | « tests/html/custom_element_bindings_test.dart ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/AttributeMap.dart
diff --git a/tools/dom/src/AttributeMap.dart b/tools/dom/src/AttributeMap.dart
index 6c96bc99a9a459f075fdde925165dc2708c1d583..b0cb0cc7fe6490a70f5a36d5650be6f63bf2d671 100644
--- a/tools/dom/src/AttributeMap.dart
+++ b/tools/dom/src/AttributeMap.dart
@@ -70,6 +70,11 @@ abstract class _AttributeMap implements Map<String, String> {
}
/**
+ * Returns true if there is at least one {key, value} pair in the map.
+ */
+ bool get isNotEmpty => !isEmpty;
+
+ /**
* Checks to see if the node should be included in this map.
*/
bool _matches(Node node);
@@ -216,6 +221,8 @@ class _DataAttributeMap implements Map<String, String> {
// TODO: Use lazy iterator when it is available on Map.
bool get isEmpty => length == 0;
+ bool get isNotEmpty => !isEmpty;
+
// Helpers.
String _attr(String key) => 'data-$key';
bool _matches(String key) => key.startsWith('data-');
« no previous file with comments | « tests/html/custom_element_bindings_test.dart ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698