Merge pull request #1084 from dtymon/03_lexerActionExecutor_hash_string_clash

JS: LexerActionExecutor cached hash string name clashes with function
This commit is contained in:
Terence Parr 2016-01-28 11:11:15 -08:00
commit 9a053d63b1
1 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ function LexerActionExecutor(lexerActions) {
this.lexerActions = lexerActions === null ? [] : lexerActions;
// Caches the result of {@link //hashCode} since the hash code is an element
// of the performance-critical {@link LexerATNConfig//hashCode} operation.
this.hashString = lexerActions.toString(); // "".join([str(la) for la in
this._hashString = lexerActions.toString(); // "".join([str(la) for la in
// lexerActions]))
return this;
}
@ -158,7 +158,7 @@ LexerActionExecutor.prototype.execute = function(lexer, input, startIndex) {
};
LexerActionExecutor.prototype.hashString = function() {
return this.hashString;
return this._hashString;
};
LexerActionExecutor.prototype.equals = function(other) {
@ -167,7 +167,7 @@ LexerActionExecutor.prototype.equals = function(other) {
} else if (!(other instanceof LexerActionExecutor)) {
return false;
} else {
return this.hashString === other.hashString &&
return this._hashString === other._hashString &&
this.lexerActions === other.lexerActions;
}
};