From ef3f45c84cabe8f79938883b57f4879a7438ee3d Mon Sep 17 00:00:00 2001 From: terussell85 Date: Wed, 19 Aug 2015 15:28:52 -0600 Subject: [PATCH] fix(preprocessor): Reset coverageObjRegex before each use --- lib/preprocessor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/preprocessor.js b/lib/preprocessor.js index 54f6075..db988c8 100644 --- a/lib/preprocessor.js +++ b/lib/preprocessor.js @@ -125,6 +125,9 @@ function createCoveragePreprocessor (logger, helper, basePath, reporters, covera sourceCache[jsPath] = content if (includeAllSources) { + // reset stateful regex + coverageObjRegex.lastIndex = 0 + var coverageObjMatch = coverageObjRegex.exec(instrumentedCode) if (coverageObjMatch !== null) {