mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 20:33:45 -05:00
Addressed CR feedback.
This commit is contained in:
@@ -4345,10 +4345,6 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function nextTokenIsStringLiteralOnSameLine() {
|
||||
return !scanner.hasPrecedingLineBreak() && token === SyntaxKind.StringLiteral;
|
||||
}
|
||||
|
||||
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
||||
nextToken();
|
||||
return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token === SyntaxKind.StringLiteral);
|
||||
@@ -5141,9 +5137,9 @@ namespace ts {
|
||||
node.exportClause = parseNamedImportsOrExports(SyntaxKind.NamedExports);
|
||||
|
||||
// It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios,
|
||||
// the 'from' keyword be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`)
|
||||
// the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`)
|
||||
// If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect.
|
||||
if (token === SyntaxKind.FromKeyword || lookAhead(nextTokenIsStringLiteralOnSameLine)) {
|
||||
if (token === SyntaxKind.FromKeyword || (token === SyntaxKind.StringLiteral && !scanner.hasPrecedingLineBreak())) {
|
||||
parseExpected(SyntaxKind.FromKeyword)
|
||||
node.moduleSpecifier = parseModuleSpecifier();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user