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

Commit

Permalink
fix(scope): fix null comparisons
Browse files Browse the repository at this point in the history
Closes #646
  • Loading branch information
chirayuk committed Mar 7, 2014
1 parent d6bc9ab commit fb0fe0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/core/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,8 @@ _operation_multiply(left, right) => (left == null || right == null
_operation_divide(left, right) => (left == null || right == null) ? null : left / right;
_operation_divide_int(left, right) => (left == null || right == null) ? null : left ~/ right;
_operation_remainder(left, right) => (left == null || right == null) ? null : left % right;
_operation_equals(left, right) => (left == null || right == null) ? null : left == right;
_operation_not_equals(left, right) => (left == null || right == null) ? null : left != right;
_operation_equals(left, right) => left == right;
_operation_not_equals(left, right) => left != right;
_operation_less_then(left, right) => (left == null || right == null) ? null : left < right;
_operation_greater_then(left, right) => (left == null || right == null) ? null : left > right;
_operation_less_or_equals_then(left, right) => (left == null || right == null) ? null : left <= right;
Expand Down
4 changes: 3 additions & 1 deletion test/core/scope_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ void main() {
..watch('3 - null', r)
..watch('null + null', r)
..watch('null - null', r)
..watch('null == null', r)
..watch('null != null', r)
..digest();
expect(logger).toEqual([null, null, 6, 5, -4, 3, 0, 0]);
expect(logger).toEqual([null, null, 6, 5, -4, 3, 0, 0, true, false]);
}));

it('should invoke closures', inject((Logger logger, Map context, RootScope rootScope) {
Expand Down

0 comments on commit fb0fe0e

Please sign in to comment.