From 7649f1555ed75ee0217b934f179c1d842ee04c1b Mon Sep 17 00:00:00 2001 From: Paulo Rafael Feodrippe Date: Sun, 24 May 2020 16:01:38 -0300 Subject: [PATCH] Check nullity for __eq__ and __ne__ `__eq__` for `Array` checks for the lenght of `b`, but `b` could be `null` --- transcrypt/modules/org/transcrypt/__builtin__.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transcrypt/modules/org/transcrypt/__builtin__.js b/transcrypt/modules/org/transcrypt/__builtin__.js index 0ca180861..f8901f639 100644 --- a/transcrypt/modules/org/transcrypt/__builtin__.js +++ b/transcrypt/modules/org/transcrypt/__builtin__.js @@ -2104,7 +2104,7 @@ export function __and__ (a, b) { // Overloaded binary compare export function __eq__ (a, b) { - if (typeof a == 'object' && '__eq__' in a) { + if (b != null && typeof a == 'object' && '__eq__' in a) { return a.__eq__ (b); } else { @@ -2113,7 +2113,7 @@ export function __eq__ (a, b) { }; export function __ne__ (a, b) { - if (typeof a == 'object' && '__ne__' in a) { + if (b != null && typeof a == 'object' && '__ne__' in a) { return a.__ne__ (b); } else {