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

Commit

Permalink
fix(syntax): warnings in directive code
Browse files Browse the repository at this point in the history
  • Loading branch information
gmacd authored and mhevery committed Nov 20, 2013
1 parent 201cbb5 commit 1f3e3f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
7 changes: 1 addition & 6 deletions lib/core_dom/directive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,5 @@ String _snakeCase(String name, [separator = '_']) {
_snakeReplace(Match match) {
return (match.start != 0 ? separator : '') + match.group(0).toLowerCase();
}
var x= name.replaceAllMapped(_SNAKE_CASE_REGEXP, _snakeReplace);
if (x is String) return x;
throw [];
return x;
return name.replaceAllMapped(_SNAKE_CASE_REGEXP, _snakeReplace);
}


16 changes: 12 additions & 4 deletions lib/directive/ng_if.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ class NgIfDirective extends _NgUnlessIfAttrDirectiveBase {
BlockHole blockHole,
Scope scope): super(boundBlockFactory, blockHole, scope);

set condition(value) =>
(toBool(value) ? _ensureBlockExists() : _ensureBlockDestroyed());
set condition(value) {
if (toBool(value))
_ensureBlockExists();
else
_ensureBlockDestroyed();
}
}


Expand Down Expand Up @@ -150,6 +154,10 @@ class NgUnlessDirective extends _NgUnlessIfAttrDirectiveBase {
BlockHole blockHole,
Scope scope): super(boundBlockFactory, blockHole, scope);

set condition(value) =>
(!toBool(value) ? _ensureBlockExists() : _ensureBlockDestroyed());
set condition(value) {
if (!toBool(value))
_ensureBlockExists();
else
_ensureBlockDestroyed();
}
}

0 comments on commit 1f3e3f7

Please sign in to comment.