Skip to content

Commit 78c4986

Browse files
committed
simplify JSRuntime.equal
1 parent cb31713 commit 78c4986

File tree

1 file changed

+2
-6
lines changed
  • graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime

1 file changed

+2
-6
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSRuntime.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,14 +1497,10 @@ public static boolean equal(Object a, Object b) {
14971497
} else if (b instanceof Boolean) {
14981498
return equal(a, booleanToNumber((Boolean) b));
14991499
} else if (isObject(a)) {
1500-
if (b == Undefined.instance || b == Null.instance) {
1501-
return false;
1502-
}
1500+
assert b != Undefined.instance && b != Null.instance; // covered by (DynOb, DynOb)
15031501
return equal(JSObject.toPrimitive((DynamicObject) a), b);
15041502
} else if (isObject(b)) {
1505-
if (a == Undefined.instance || a == Null.instance) {
1506-
return false;
1507-
}
1503+
assert b != Undefined.instance && b != Null.instance; // covered by (DynOb, DynOb)
15081504
return equal(a, JSObject.toPrimitive(((DynamicObject) b)));
15091505
} else if (isForeignObject(a) || isForeignObject(b)) {
15101506
return equalInterop(a, b);

0 commit comments

Comments
 (0)