From 0416c6fdb8923c5d4aef88bbee72bf523fd3f277 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 17 Nov 2014 15:31:58 -0800 Subject: [PATCH] Fixed isUnclosedTemplateLiteral to account for new possible inputs. --- src/compiler/parser.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 804f8c9780c..7db9b9101da 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -819,6 +819,11 @@ module ts { return false; } + // We can only be unclosed if we have a tail or a no-sub template. + if (node.kind !== SyntaxKind.TemplateTail && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) { + return false; + } + // If we didn't end in a backtick, we must still be in the middle of a template. // If we did, make sure that it's not the *initial* backtick. return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0;