From 0ed5efdf69912b3a1787a7c96caff7f53efc1060 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Wed, 3 May 2017 12:30:02 +0300 Subject: [PATCH] Match: Fixed this.restoreDepth call possibly (issue #433) --- lib/bemxjst/match.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bemxjst/match.js b/lib/bemxjst/match.js index cf8eb8d4..e1def1b0 100644 --- a/lib/bemxjst/match.js +++ b/lib/bemxjst/match.js @@ -188,8 +188,11 @@ Match.prototype.exec = function(context) { } } - if (i === this.count) + if (i === this.count) { + this.restoreDepth(save); + return context.ctx[this.modeName]; + } var oldMask = mask; var oldMatch = this.bemxjst.match;