mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixed isUnclosedTemplateLiteral to account for new possible inputs.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user