From 82f0f384d14d924fd605c179b7e9ffcfea0cbd16 Mon Sep 17 00:00:00 2001 From: Neek Sandhu Date: Sun, 20 May 2018 14:35:25 -0700 Subject: [PATCH] add `ruleStack` comparison in `TokenizerState.equals` method --- src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index e5b45be..eb3c810 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,10 +16,11 @@ class TokenizerState implements monacoNsps.languages.IState { } public equals(other: monacoNsps.languages.IState): boolean { - if (other === this) { - return true; - } - if (!other || !(other instanceof TokenizerState)) { + if (!other || + !(other instanceof TokenizerState) || + other !== this || + other._ruleStack !== this._ruleStack + ) { return false; } return true;