Skip to content

Commit

Permalink
Merge pull request #2864 from antlr/fix-javascript-NPE
Browse files Browse the repository at this point in the history
Fix a NPE
  • Loading branch information
parrt authored Jul 12, 2020
2 parents 3d9351f + 2bfce77 commit eb1adaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/JavaScript/src/antlr4/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ String.prototype.hashCode = function () {
};

function standardEqualsFunction(a, b) {
return a.equals(b);
return a ? a.equals(b) : a==b;
}

function standardHashCodeFunction(a) {
return a.hashCode();
return a ? a.hashCode() : -1;
}

class Set {
Expand Down

0 comments on commit eb1adaa

Please sign in to comment.