diff --git a/runtime/JavaScript/src/antlr4/PredictionContext.js b/runtime/JavaScript/src/antlr4/PredictionContext.js index e10b0a662..b40cc79ed 100644 --- a/runtime/JavaScript/src/antlr4/PredictionContext.js +++ b/runtime/JavaScript/src/antlr4/PredictionContext.js @@ -7,6 +7,7 @@ const RuleContext = require('./RuleContext'); const {Hash, Map, equalArrays} = require('./Utils'); class PredictionContext { + constructor(cachedHashCode) { this.cachedHashCode = cachedHashCode; } @@ -83,6 +84,7 @@ function calculateHashString(parent, returnState) { * can be used for both lexers and parsers. */ class PredictionContextCache { + constructor() { this.cache = new Map(); } @@ -115,6 +117,7 @@ class PredictionContextCache { class SingletonPredictionContext extends PredictionContext { + constructor(parent, returnState) { let hashCode = 0; const hash = new Hash(); @@ -182,6 +185,7 @@ class SingletonPredictionContext extends PredictionContext { } class EmptyPredictionContext extends SingletonPredictionContext { + constructor() { super(null, PredictionContext.EMPTY_RETURN_STATE); } @@ -211,6 +215,7 @@ class EmptyPredictionContext extends SingletonPredictionContext { PredictionContext.EMPTY = new EmptyPredictionContext(); class ArrayPredictionContext extends PredictionContext { + constructor(parents, returnStates) { /** * Parent can be null only if full ctx mode and we make an array diff --git a/runtime/JavaScript/src/antlr4/atn/ATN.js b/runtime/JavaScript/src/antlr4/atn/ATN.js index 79c84b213..6125f4f4a 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATN.js +++ b/runtime/JavaScript/src/antlr4/atn/ATN.js @@ -8,8 +8,8 @@ const {IntervalSet} = require('./../IntervalSet'); const {Token} = require('./../Token'); class ATN { - constructor(grammarType , maxTokenType) { + constructor(grammarType , maxTokenType) { /** * Used for runtime deserialization of ATNs from strings * The type of the ATN.