Skip to content

Commit 2094ac8

Browse files
committed
Test fixes
1 parent f806d4b commit 2094ac8

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/core/parse/interpreter.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
isDefined,
33
isFunction,
4-
isNullOrUndefined,
54
isObject,
65
isProxy,
76
} from "../../shared/utils.js";
@@ -200,7 +199,7 @@ export class ASTInterpreter {
200199

201200
let value;
202201

203-
if (!isNullOrUndefined(rhs.value) && isFunction(rhs.value)) {
202+
if (rhs.value != null && isFunction(rhs.value)) {
204203
const values = [];
205204

206205
for (let i = 0; i < args.length; ++i) {
@@ -465,7 +464,7 @@ export class ASTInterpreter {
465464
*/
466465
"binary=="(left, right, context) {
467466
return (scope, locals, assign) => {
468-
const arg = left(scope, locals, assign) === right(scope, locals, assign);
467+
const arg = left(scope, locals, assign) == right(scope, locals, assign);
469468

470469
return context ? { value: arg } : arg;
471470
};
@@ -480,7 +479,7 @@ export class ASTInterpreter {
480479
*/
481480
"binary!="(left, right, context) {
482481
return (scope, locals, assign) => {
483-
const arg = left(scope, locals, assign) !== right(scope, locals, assign);
482+
const arg = left(scope, locals, assign) != right(scope, locals, assign);
484483

485484
return context ? { value: arg } : arg;
486485
};
@@ -617,7 +616,7 @@ export class ASTInterpreter {
617616
const base =
618617
locals && name in locals ? locals : ((scope && scope.$proxy) ?? scope);
619618

620-
if (create && create !== 1 && base && isNullOrUndefined(base[name])) {
619+
if (create && create !== 1 && base && base[name] == null) {
621620
base[name] = {};
622621
}
623622
let value = undefined;
@@ -650,7 +649,7 @@ export class ASTInterpreter {
650649

651650
let value;
652651

653-
if (!isNullOrUndefined(lhs)) {
652+
if (lhs != null) {
654653
rhs = right(scope, locals, assign);
655654
rhs = getStringValue(rhs);
656655

@@ -683,11 +682,11 @@ export class ASTInterpreter {
683682
const lhs = left(scope, locals, assign);
684683

685684
if (create && create !== 1) {
686-
if (lhs && isNullOrUndefined(lhs[right])) {
685+
if (lhs && lhs[right] == null) {
687686
lhs[right] = {};
688687
}
689688
}
690-
const value = !isNullOrUndefined(lhs) ? lhs[right] : undefined;
689+
const value = lhs != null ? lhs[right] : undefined;
691690

692691
if (context) {
693692
return { context: lhs, name: right, value };
@@ -928,8 +927,6 @@ function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
928927

929928
return decoratedNode;
930929
}
931-
932-
return undefined;
933930
}
934931

935932
/**

src/filters/limit-to.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function limitToFilter() {
3333
if (!isArrayLike(input)) return input;
3434

3535
begin =
36-
!begin || Number.isNaN(/** @type {any} */ (begin))
36+
!begin || isNaN(/** @type {any} */ (begin))
3737
? 0
3838
: parseInt(/** @type {string} */ (begin), 10);
3939
begin =

0 commit comments

Comments
 (0)