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

Unified Diff: third_party/pkg/angular/lib/tools/selector.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: third_party/pkg/angular/lib/tools/selector.dart
diff --git a/third_party/pkg/angular/lib/tools/selector.dart b/third_party/pkg/angular/lib/tools/selector.dart
index 01cb503c656c412ff8f07d7e3dc5314fff11e7aa..10510cc8813f8295e9585dfe097442ac54f037c3 100644
--- a/third_party/pkg/angular/lib/tools/selector.dart
+++ b/third_party/pkg/angular/lib/tools/selector.dart
@@ -22,17 +22,17 @@ class _SelectorPart {
final String attrName;
final String attrValue;
- const _SelectorPart.fromElement(String this.element)
+ const _SelectorPart.fromElement(this.element)
: className = null, attrName = null, attrValue = null;
- const _SelectorPart.fromClass(String this.className)
+ const _SelectorPart.fromClass(this.className)
: element = null, attrName = null, attrValue = null;
- const _SelectorPart.fromAttribute(String this.attrName, String this.attrValue)
+ const _SelectorPart.fromAttribute(this.attrName, this.attrValue)
: element = null, className = null;
- toString() =>
+ String toString() =>
element == null
? (className == null
? (attrValue == '' ? '[$attrName]' : '[$attrName=$attrValue]')
@@ -71,7 +71,7 @@ bool matchesNode(Node node, String selector) {
if (node is! Text) {
return false;
}
- return new RegExp(match.group(1)).hasMatch((node as Text).value);
+ return new RegExp(match.group(1)).hasMatch((node as Text).text);
} else if ((match = _ATTR_CONTAINS_REGEXP.firstMatch(selector)) != null) {
if (node is! Element) {
return false;
@@ -84,10 +84,8 @@ bool matchesNode(Node node, String selector) {
}
return false;
} else if ((selectorParts = _splitCss(selector)) != null) {
- if (node is! Element) {
- return false;
- }
- String nodeName = node.tagName.toLowerCase();
+ if (node is! Element) return false;
+ String nodeName = (node as Element).localName.toLowerCase();
bool stillGood = true;
selectorParts.forEach((_SelectorPart part) {
@@ -111,8 +109,8 @@ bool matchesNode(Node node, String selector) {
});
return stillGood;
- }
-
+ }
+
throw new ArgumentError('Unsupported Selector: $selector');
}

Powered by Google App Engine
This is Rietveld 408576698