From 6429750081031e29a78977aa815ac33407f6fbd6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Jan 2021 13:56:29 +0000 Subject: [PATCH] Quick fix for an issue found while checking string templates. --- packages/string-templates/src/processors/preprocessor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/string-templates/src/processors/preprocessor.js b/packages/string-templates/src/processors/preprocessor.js index 131fb522f9..c984d61298 100644 --- a/packages/string-templates/src/processors/preprocessor.js +++ b/packages/string-templates/src/processors/preprocessor.js @@ -31,7 +31,8 @@ module.exports.processors = [ statement = swapStrings(statement, startBraceIdx + lastIdx, 1, ".[") } lastIdx = startBraceIdx + 1 - startBraceIdx = statement.substring(lastIdx + 1).indexOf("[") + const nextBraceIdx = statement.substring(lastIdx + 1).indexOf("[") + startBraceIdx = nextBraceIdx > 0 ? lastIdx + 1 + nextBraceIdx : -1 } return statement }),