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

Unified Diff: lib/html/templates/html/impl/impl_Element.darttemplate

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 2 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/html/src/native_DOMImplementation.dart ('k') | lib/html/templates/html/impl/impl_Storage.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/templates/html/impl/impl_Element.darttemplate
diff --git a/lib/html/templates/html/impl/impl_Element.darttemplate b/lib/html/templates/html/impl/impl_Element.darttemplate
index 4f516ac2b6f51bba62455edff16c8e0394891775..e7610dd97dfe677d9fcd1aa186c3bae53e7756d9 100644
--- a/lib/html/templates/html/impl/impl_Element.darttemplate
+++ b/lib/html/templates/html/impl/impl_Element.darttemplate
@@ -352,7 +352,7 @@ class _ElementAttributeMap implements AttributeMap {
}
}
- Collection<String> getKeys() {
+ Collection<String> get keys {
// TODO(jacobr): generate a lazy collection instead.
final attributes = _element.$dom_attributes;
final keys = new List<String>(attributes.length);
@@ -362,7 +362,7 @@ class _ElementAttributeMap implements AttributeMap {
return keys;
}
- Collection<String> getValues() {
+ Collection<String> get values {
// TODO(jacobr): generate a lazy collection instead.
final attributes = _element.$dom_attributes;
final values = new List<String>(attributes.length);
@@ -400,7 +400,7 @@ class _DataAttributeMap implements AttributeMap {
// interface Map
// TODO: Use lazy iterator when it is available on Map.
- bool containsValue(String value) => getValues().some((v) => v == value);
+ bool containsValue(String value) => values.some((v) => v == value);
bool containsKey(String key) => $dom_attributes.containsKey(_attr(key));
@@ -417,7 +417,7 @@ class _DataAttributeMap implements AttributeMap {
void clear() {
// Needs to operate on a snapshot since we are mutating the collection.
- for (String key in getKeys()) {
+ for (String key in keys) {
remove(key);
}
}
@@ -430,7 +430,7 @@ class _DataAttributeMap implements AttributeMap {
});
}
- Collection<String> getKeys() {
+ Collection<String> get keys {
final keys = new List<String>();
$dom_attributes.forEach((String key, String value) {
if (_matches(key)) {
@@ -440,7 +440,7 @@ class _DataAttributeMap implements AttributeMap {
return keys;
}
- Collection<String> getValues() {
+ Collection<String> get values {
final values = new List<String>();
$dom_attributes.forEach((String key, String value) {
if (_matches(key)) {
@@ -450,7 +450,7 @@ class _DataAttributeMap implements AttributeMap {
return values;
}
- int get length => getKeys().length;
+ int get length => keys.length;
// TODO: Use lazy iterator when it is available on Map.
bool get isEmpty => length == 0;
@@ -672,7 +672,7 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
void set attributes(Map<String, String> value) {
Map<String, String> attributes = this.attributes;
attributes.clear();
- for (String key in value.getKeys()) {
+ for (String key in value.keys) {
attributes[key] = value[key];
}
}
@@ -704,7 +704,7 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
void set dataAttributes(Map<String, String> value) {
final dataAttributes = this.dataAttributes;
dataAttributes.clear();
- for (String key in value.getKeys()) {
+ for (String key in value.keys) {
dataAttributes[key] = value[key];
}
}
« no previous file with comments | « lib/html/src/native_DOMImplementation.dart ('k') | lib/html/templates/html/impl/impl_Storage.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698