Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 5b70fcc

Browse files
committed
fix: fix deprecation warnings
1 parent c064356 commit 5b70fcc

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

lib/core_dom/common.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DirectiveRef {
1212
final Type type;
1313
final NgAnnotation annotation;
1414
final String value;
15-
final List<ApplyMapping> mappings = new List<ApplyMapping>();
15+
final mappings = new List<ApplyMapping>();
1616

1717
DirectiveRef(this.element, this.type, this.annotation, [ this.value ]);
1818

lib/directive/ng_form.dart

+2-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ class NgForm extends NgControl {
6969

7070
get controls => _controlByName;
7171

72-
NgControl operator[](name) {
73-
if (controls.containsKey(name)) {
74-
return controls[name][0];
75-
}
76-
}
72+
NgControl operator[](name) =>
73+
controls.containsKey(name) ? controls[name][0] : null;
7774
}
7875

7976
class NgNullForm extends NgNullControl implements NgForm {

lib/tools/html_extractor.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class HtmlExpressionExtractor {
4444
});
4545
}
4646
if (matchesNode(node, r':contains(/{{.*}}/)')) {
47-
_MUSTACHE_REGEXP.allMatches(node.value).forEach((match) {
47+
_MUSTACHE_REGEXP.allMatches(node.text).forEach((match) {
4848
expressions.add(match.group(1));
4949
});
5050
}

lib/tools/selector.dart

+5-7
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool matchesNode(Node node, String selector) {
7171
if (node is! Text) {
7272
return false;
7373
}
74-
return new RegExp(match.group(1)).hasMatch((node as Text).value);
74+
return new RegExp(match.group(1)).hasMatch((node as Text).text);
7575
} else if ((match = _ATTR_CONTAINS_REGEXP.firstMatch(selector)) != null) {
7676
if (node is! Element) {
7777
return false;
@@ -84,10 +84,8 @@ bool matchesNode(Node node, String selector) {
8484
}
8585
return false;
8686
} else if ((selectorParts = _splitCss(selector)) != null) {
87-
if (node is! Element) {
88-
return false;
89-
}
90-
String nodeName = node.tagName.toLowerCase();
87+
if (node is! Element) return false;
88+
String nodeName = (node as Element).localName.toLowerCase();
9189

9290
bool stillGood = true;
9391
selectorParts.forEach((_SelectorPart part) {
@@ -111,8 +109,8 @@ bool matchesNode(Node node, String selector) {
111109
});
112110

113111
return stillGood;
114-
}
115-
112+
}
113+
116114
throw new ArgumentError('Unsupported Selector: $selector');
117115
}
118116

test/_specs.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class JQuery extends DelegatingList<Node> {
184184
// Remove all the "ng-binding" internal classes
185185
node = node.clone(true) as Element;
186186
node.classes.remove('ng-binding');
187-
node.queryAll(".ng-binding").forEach((Element e) {
187+
node.querySelectorAll(".ng-binding").forEach((Element e) {
188188
e.classes.remove('ng-binding');
189189
});
190190
var htmlString = outer ? node.outerHtml : node.innerHtml;

0 commit comments

Comments
 (0)