Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export class ChangeDetectionUtil {
static operation_remainder(left, right) { return left % right; }
static operation_equals(left, right) { return left == right; }
static operation_not_equals(left, right) { return left != right; }
static operation_identical(left, right) { return left === right; }
static operation_not_identical(left, right) { return left !== right; }
static operation_less_then(left, right) { return left < right; }
static operation_greater_then(left, right) { return left > right; }
static operation_less_or_equals_then(left, right) { return left <= right; }
Expand Down Expand Up @@ -140,4 +142,4 @@ export class ChangeDetectionUtil {
changes[propertyName] = change;
return changes;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ function _operationToPrimitiveName(operation: string): string {
return "operation_equals";
case '!=':
return "operation_not_equals";
case '===':
return "operation_identical";
case '!==':
return "operation_not_identical";
case '<':
return "operation_less_then";
case '>':
Expand Down Expand Up @@ -319,6 +323,10 @@ function _operationToFunction(operation: string): Function {
return ChangeDetectionUtil.operation_equals;
case '!=':
return ChangeDetectionUtil.operation_not_equals;
case '===':
return ChangeDetectionUtil.operation_identical;
case '!==':
return ChangeDetectionUtil.operation_not_identical;
case '<':
return ChangeDetectionUtil.operation_less_then;
case '>':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,17 @@ export function main() {
expect(executeWatch('exp', '11 % 2')).toEqual(['exp=1']);

expect(executeWatch('exp', '1 == 1')).toEqual(['exp=true']);
if (IS_DARTIUM) {
expect(executeWatch('exp', '1 == "1"')).toEqual(['exp=false']);
} else {
expect(executeWatch('exp', '1 == "1"')).toEqual(['exp=true']);
}
expect(executeWatch('exp', '1 != 1')).toEqual(['exp=false']);

expect(executeWatch('exp', '1 === 1')).toEqual(['exp=true']);
expect(executeWatch('exp', '1 !== 1')).toEqual(['exp=false']);
expect(executeWatch('exp', '1 === "1"')).toEqual(['exp=false']);

expect(executeWatch('exp', '1 < 2')).toEqual(['exp=true']);
expect(executeWatch('exp', '2 < 1')).toEqual(['exp=false']);

Expand Down