@@ -1205,7 +1205,7 @@ namespace ts {
1205
1205
}
1206
1206
if ( ch === CharacterCodes . backslash && ! jsxAttributeString ) {
1207
1207
result += text . substring ( start , pos ) ;
1208
- result += scanEscapeSequence ( false , true ) ;
1208
+ result += scanEscapeSequence ( /* isTaggedTemplate */ false , /* shouldEmitInvalidEscapeError */ true ) ;
1209
1209
start = pos ;
1210
1210
continue ;
1211
1211
}
@@ -1501,7 +1501,7 @@ namespace ts {
1501
1501
if ( ch >= 0 && isIdentifierPart ( ch , languageVersion ) ) {
1502
1502
pos += 3 ;
1503
1503
tokenFlags |= TokenFlags . ExtendedUnicodeEscape ;
1504
- result += scanExtendedUnicodeEscape ( true ) ;
1504
+ result += scanExtendedUnicodeEscape ( /* shouldEmitInvalidEscapeError */ true ) ;
1505
1505
start = pos ;
1506
1506
continue ;
1507
1507
}
@@ -1686,7 +1686,7 @@ namespace ts {
1686
1686
tokenValue = scanString ( ) ;
1687
1687
return token = SyntaxKind . StringLiteral ;
1688
1688
case CharacterCodes . backtick :
1689
- return token = scanTemplateAndSetTokenValue ( /* isTaggedTemplate */ false , false ) ;
1689
+ return token = scanTemplateAndSetTokenValue ( /* isTaggedTemplate */ false , /* shouldEmitInvalidEscapeError */ false ) ;
1690
1690
case CharacterCodes . percent :
1691
1691
if ( text . charCodeAt ( pos + 1 ) === CharacterCodes . equals ) {
1692
1692
return pos += 2 , token = SyntaxKind . PercentEqualsToken ;
@@ -2021,7 +2021,7 @@ namespace ts {
2021
2021
if ( extendedCookedChar >= 0 && isIdentifierStart ( extendedCookedChar , languageVersion ) ) {
2022
2022
pos += 3 ;
2023
2023
tokenFlags |= TokenFlags . ExtendedUnicodeEscape ;
2024
- tokenValue = scanExtendedUnicodeEscape ( true ) + scanIdentifierParts ( ) ;
2024
+ tokenValue = scanExtendedUnicodeEscape ( /* shouldEmitInvalidEscapeError */ true ) + scanIdentifierParts ( ) ;
2025
2025
return token = getIdentifierToken ( ) ;
2026
2026
}
2027
2027
@@ -2208,12 +2208,12 @@ namespace ts {
2208
2208
function reScanTemplateToken ( isTaggedTemplate : boolean ) : SyntaxKind {
2209
2209
Debug . assert ( token === SyntaxKind . CloseBraceToken , "'reScanTemplateToken' should only be called on a '}'" ) ;
2210
2210
pos = tokenPos ;
2211
- return token = scanTemplateAndSetTokenValue ( isTaggedTemplate , true ) ;
2211
+ return token = scanTemplateAndSetTokenValue ( isTaggedTemplate , /* shouldEmitInvalidEscapeError */ true ) ;
2212
2212
}
2213
2213
2214
2214
function reScanTemplateHeadOrNoSubstitutionTemplate ( isTaggedTemplate ?: boolean ) : SyntaxKind {
2215
2215
pos = tokenPos ;
2216
- return token = scanTemplateAndSetTokenValue ( isTaggedTemplate || false , true ) ;
2216
+ return token = scanTemplateAndSetTokenValue ( isTaggedTemplate || false , /* shouldEmitInvalidEscapeError */ true ) ;
2217
2217
}
2218
2218
2219
2219
function reScanJsxToken ( ) : JsxTokenSyntaxKind {
@@ -2413,7 +2413,7 @@ namespace ts {
2413
2413
if ( extendedCookedChar >= 0 && isIdentifierStart ( extendedCookedChar , languageVersion ) ) {
2414
2414
pos += 3 ;
2415
2415
tokenFlags |= TokenFlags . ExtendedUnicodeEscape ;
2416
- tokenValue = scanExtendedUnicodeEscape ( true ) + scanIdentifierParts ( ) ;
2416
+ tokenValue = scanExtendedUnicodeEscape ( /* shouldEmitInvalidEscapeError */ true ) + scanIdentifierParts ( ) ;
2417
2417
return token = getIdentifierToken ( ) ;
2418
2418
}
2419
2419
0 commit comments