Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint

This commit is contained in:
Alexander T committed 2019-07-29 18:39:29 +03:00
commit 1b4dfbc7d6
65 files changed
+2538 -871

No files matched your search

+5 -2
View File
@@ -445,9 +445,12 @@ namespace ts.codefix {
const aliased = checker.getImmediateAliasedSymbol(defaultExport);
return aliased && getDefaultExportInfoWorker(aliased, Debug.assertDefined(aliased.parent), checker, compilerOptions);
}
else {
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target!) };
if (defaultExport.escapedName !== InternalSymbolName.Default &&
defaultExport.escapedName !== InternalSymbolName.ExportEquals) {
return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
}
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target!) };
}
function getNameForExportDefault(symbol: Symbol): string | undefined {
+2 -3
View File
@@ -71,9 +71,8 @@ namespace ts.OutliningElementsCollector {
function addRegionOutliningSpans(sourceFile: SourceFile, out: Push<OutliningSpan>): void {
const regions: OutliningSpan[] = [];
const lineStarts = sourceFile.getLineStarts();
for (let i = 0; i < lineStarts.length; i++) {
const currentLineStart = lineStarts[i];
const lineEnd = i + 1 === lineStarts.length ? sourceFile.getEnd() : lineStarts[i + 1] - 1;
for (const currentLineStart of lineStarts) {
const lineEnd = sourceFile.getLineEndOfPosition(currentLineStart);
const lineText = sourceFile.text.substring(currentLineStart, lineEnd);
const result = isRegionDelimiter(lineText);
if (!result || isInComment(sourceFile, currentLineStart)) {
+7
View File
@@ -64,6 +64,13 @@ namespace ts.SmartSelectionRange {
parentNode = node;
break;
}
// If we made it to the end of the for loop, we’re done.
// In practice, I’ve only seen this happen at the very end
// of a SourceFile.
if (i === children.length - 1) {
break outer;
}
}
}