Skip to content

Commit 79c0150

Browse files
author
Andy Hanson
committed
Merge branch 'master' into codeFixAll
2 parents f2031be + 8dca431 commit 79c0150

File tree

11 files changed

+223
-98
lines changed

11 files changed

+223
-98
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ namespace ts {
10201020

10211021
// It's an external module. First see if the module has an export default and if the local
10221022
// name of that export default matches.
1023-
if (result = moduleExports.get("default" as __String)) {
1023+
if (result = moduleExports.get(InternalSymbolName.Default)) {
10241024
const localSymbol = getLocalSymbolForExportDefault(result);
10251025
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
10261026
break loop;
@@ -1474,8 +1474,8 @@ namespace ts {
14741474
else {
14751475
const exportValue = moduleSymbol.exports.get("export=" as __String);
14761476
exportDefaultSymbol = exportValue
1477-
? getPropertyOfType(getTypeOfSymbol(exportValue), "default" as __String)
1478-
: resolveSymbol(moduleSymbol.exports.get("default" as __String), dontResolveAlias);
1477+
? getPropertyOfType(getTypeOfSymbol(exportValue), InternalSymbolName.Default)
1478+
: resolveSymbol(moduleSymbol.exports.get(InternalSymbolName.Default), dontResolveAlias);
14791479
}
14801480

14811481
if (!exportDefaultSymbol && !allowSyntheticDefaultImports) {
@@ -1564,7 +1564,7 @@ namespace ts {
15641564
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
15651565
let symbolFromModule = getExportOfModule(targetSymbol, name.escapedText, dontResolveAlias);
15661566
// If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default
1567-
if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default") {
1567+
if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === InternalSymbolName.Default) {
15681568
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
15691569
}
15701570
const symbol = symbolFromModule && symbolFromVariable ?
@@ -1951,7 +1951,7 @@ namespace ts {
19511951
function extendExportSymbols(target: SymbolTable, source: SymbolTable | undefined, lookupTable?: ExportCollisionTrackerTable, exportNode?: ExportDeclaration) {
19521952
if (!source) return;
19531953
source.forEach((sourceSymbol, id) => {
1954-
if (id === "default") return;
1954+
if (id === InternalSymbolName.Default) return;
19551955

19561956
const targetSymbol = target.get(id);
19571957
if (!targetSymbol) {
@@ -3221,7 +3221,7 @@ namespace ts {
32213221
* ensuring that any names written with literals use element accesses.
32223222
*/
32233223
function appendPropertyOrElementAccessForSymbol(symbol: Symbol, writer: SymbolWriter): void {
3224-
const symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol);
3224+
const symbolName = symbol.escapedName === InternalSymbolName.Default ? InternalSymbolName.Default : getNameOfSymbolAsWritten(symbol);
32253225
const firstChar = symbolName.charCodeAt(0);
32263226
const needsElementAccess = !isIdentifierStart(firstChar, languageVersion);
32273227

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,6 +2828,10 @@
28282828
"category": "Message",
28292829
"code": 6030
28302830
},
2831+
"Starting compilation in watch mode...": {
2832+
"category": "Message",
2833+
"code": 6031
2834+
},
28312835
"File change detected. Starting incremental compilation...": {
28322836
"category": "Message",
28332837
"code": 6032

src/compiler/watch.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ namespace ts {
302302
// There is no extra check needed since we can just rely on the program to decide emit
303303
const builder = createBuilder({ getCanonicalFileName, computeHash });
304304

305+
clearHostScreen();
306+
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.Starting_compilation_in_watch_mode));
305307
synchronizeProgram();
306308

307309
// Update the wild card directory watch
@@ -492,10 +494,14 @@ namespace ts {
492494
scheduleProgramUpdate();
493495
}
494496

495-
function updateProgram() {
497+
function clearHostScreen() {
496498
if (watchingHost.system.clearScreen) {
497499
watchingHost.system.clearScreen();
498500
}
501+
}
502+
503+
function updateProgram() {
504+
clearHostScreen();
499505

500506
timerToUpdateProgram = undefined;
501507
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation));

0 commit comments

Comments
 (0)