mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Update checking for semanticErrors and fix spelling
This commit is contained in:
parent
54dcf39674
commit
58f155d06b
@ -3163,22 +3163,13 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
var hasSemanticErros = resolver.hasSemanticErrors();
|
||||
var returnCode = EmitReturnStatus.Succeeded;
|
||||
var hasSemanticErrors = resolver.hasSemanticErrors();
|
||||
|
||||
function emitFile(jsFilePath: string, sourceFile?: SourceFile) {
|
||||
emitJavaScript(jsFilePath, sourceFile);
|
||||
// Update the returnCode with appropriate value depended on whether we have semantic errors
|
||||
if (!hasSemanticErros && compilerOptions.declaration) {
|
||||
returnCode = EmitReturnStatus.Succeeded;
|
||||
if (!hasSemanticErrors && compilerOptions.declaration) {
|
||||
emitDeclarations(jsFilePath, sourceFile);
|
||||
}
|
||||
else if (hasSemanticErros && compilerOptions.declaration) {
|
||||
returnCode = EmitReturnStatus.DeclarationGenerationSkipped;
|
||||
}
|
||||
else if (hasSemanticErros && !compilerOptions.declaration) {
|
||||
returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors;
|
||||
}
|
||||
}
|
||||
|
||||
if (targetSourceFile === undefined) {
|
||||
@ -3206,8 +3197,16 @@ module ts {
|
||||
// Update returnCode if there is any EmitterError
|
||||
var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error);
|
||||
|
||||
// Check and update returnCode for syntactic and semantic
|
||||
var returnCode: EmitReturnStatus;
|
||||
if (hasEmitterError) {
|
||||
returnCode = EmitReturnStatus.EmitErrorsEncountered;
|
||||
} else if (hasSemanticErrors && compilerOptions.declaration) {
|
||||
returnCode = EmitReturnStatus.DeclarationGenerationSkipped;
|
||||
} else if (hasSemanticErrors && !compilerOptions.declaration) {
|
||||
returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors;
|
||||
} else {
|
||||
returnCode = EmitReturnStatus.Succeeded;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user