Add check to verify expressions are strings (#883)

This commit is contained in:
toasted-nutbread 2020-10-04 19:04:21 -04:00 committed by GitHub
parent f904b3e11a
commit 8b8806484e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1176,6 +1176,8 @@ class Translator {
const expression1 = v1.expression;
const expression2 = v2.expression;
if (typeof expression1 !== 'string' || typeof expression2 !== 'string') { return 0; } // Skip if either is not a string (array)
i = expression2.length - expression1.length;
if (i !== 0) { return i; }