From 14bdd921870ad40b0aa267b632ec93096847d675 Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Tue, 8 Sep 2020 15:08:51 -0400 Subject: [PATCH] more comments --- lighthouse-core/lib/minification-estimator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/lib/minification-estimator.js b/lighthouse-core/lib/minification-estimator.js index 214e885e064b..c91a77b5743c 100644 --- a/lighthouse-core/lib/minification-estimator.js +++ b/lighthouse-core/lib/minification-estimator.js @@ -142,10 +142,11 @@ function computeTokenLength(content, features) { // Regex characters count totalTokenLength++; } else if (char === '{' && templateLiteralDepth) { + // Start normal code brace if inside a template literal templateLiteralDepth.push(false); totalTokenLength++; } else if (char === '}' && templateLiteralDepth) { - // End one template literal if closing brace in normal code + // End one template literal if closing brace is for a template literal if (templateLiteralDepth[templateLiteralDepth.length - 1]) { isInString = true; stringOpenChar = '`';