Skip to content

Commit e63d795

Browse files
Rename function.
1 parent 350d768 commit e63d795

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10116,7 +10116,7 @@ module ts {
1011610116
return isImportResolvedToValue(getSymbolOfNode(node));
1011710117
}
1011810118

10119-
function hasSemanticErrors(sourceFile?: SourceFile) {
10119+
function hasSemanticDiagnostics(sourceFile?: SourceFile) {
1012010120
// Return true if there is any semantic error in a file or globally
1012110121
return getDiagnostics(sourceFile).length > 0 || getGlobalDiagnostics().length > 0;
1012210122
}
@@ -10215,7 +10215,7 @@ module ts {
1021510215
getNodeCheckFlags,
1021610216
getEnumMemberValue,
1021710217
isTopLevelValueImportWithEntityName,
10218-
hasSemanticErrors,
10218+
hasSemanticDiagnostics,
1021910219
isDeclarationVisible,
1022010220
isImplementationOfOverload,
1022110221
writeTypeOfDeclaration,

src/compiler/emitter.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -4372,12 +4372,12 @@ module ts {
43724372
}
43734373
}
43744374

4375-
var hasSemanticErrors: boolean = false;
4376-
var isEmitBlocked: boolean = false;
4375+
var hasSemanticDiagnostics = false;
4376+
var isEmitBlocked = false;
43774377

43784378
if (targetSourceFile === undefined) {
43794379
// No targetSourceFile is specified (e.g. calling emitter from batch compiler)
4380-
hasSemanticErrors = resolver.hasSemanticErrors();
4380+
hasSemanticDiagnostics = resolver.hasSemanticDiagnostics();
43814381
isEmitBlocked = host.isEmitBlocked();
43824382

43834383
forEach(host.getSourceFiles(), sourceFile => {
@@ -4395,7 +4395,7 @@ module ts {
43954395
// targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service)
43964396
if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) {
43974397
// If shouldEmitToOwnFile returns true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file
4398-
hasSemanticErrors = resolver.hasSemanticErrors(targetSourceFile);
4398+
hasSemanticDiagnostics = resolver.hasSemanticDiagnostics(targetSourceFile);
43994399
isEmitBlocked = host.isEmitBlocked(targetSourceFile);
44004400

44014401
var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js");
@@ -4406,7 +4406,7 @@ module ts {
44064406
// Emit all, non-external-module file, into one single output file
44074407
forEach(host.getSourceFiles(), sourceFile => {
44084408
if (!shouldEmitToOwnFile(sourceFile, compilerOptions)) {
4409-
hasSemanticErrors = hasSemanticErrors || resolver.hasSemanticErrors(sourceFile);
4409+
hasSemanticDiagnostics = hasSemanticDiagnostics || resolver.hasSemanticDiagnostics(sourceFile);
44104410
isEmitBlocked = isEmitBlocked || host.isEmitBlocked(sourceFile);
44114411
}
44124412
});
@@ -4418,7 +4418,7 @@ module ts {
44184418
function emitFile(jsFilePath: string, sourceFile?: SourceFile) {
44194419
if (!isEmitBlocked) {
44204420
emitJavaScript(jsFilePath, sourceFile);
4421-
if (!hasSemanticErrors && compilerOptions.declaration) {
4421+
if (!hasSemanticDiagnostics && compilerOptions.declaration) {
44224422
writeDeclarationFile(jsFilePath, sourceFile);
44234423
}
44244424
}
@@ -4437,9 +4437,9 @@ module ts {
44374437
emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped;
44384438
} else if (hasEmitterError) {
44394439
emitResultStatus = EmitReturnStatus.EmitErrorsEncountered;
4440-
} else if (hasSemanticErrors && compilerOptions.declaration) {
4440+
} else if (hasSemanticDiagnostics && compilerOptions.declaration) {
44414441
emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped;
4442-
} else if (hasSemanticErrors && !compilerOptions.declaration) {
4442+
} else if (hasSemanticDiagnostics && !compilerOptions.declaration) {
44434443
emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors;
44444444
} else {
44454445
emitResultStatus = EmitReturnStatus.Succeeded;

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ module ts {
11231123
isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean;
11241124
getNodeCheckFlags(node: Node): NodeCheckFlags;
11251125
getEnumMemberValue(node: EnumMember): number;
1126-
hasSemanticErrors(sourceFile?: SourceFile): boolean;
1126+
hasSemanticDiagnostics(sourceFile?: SourceFile): boolean;
11271127
isDeclarationVisible(node: Declaration): boolean;
11281128
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean;
11291129
writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;

0 commit comments

Comments
 (0)