mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Simplify the API for emitting and reporting exit statuses to callers.
This commit is contained in:
parent
e7f6693eda
commit
66a363f449
@ -1508,7 +1508,8 @@ module ts {
|
||||
|
||||
// @internal
|
||||
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compilerOnSave feature
|
||||
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
|
||||
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult
|
||||
{
|
||||
var compilerOptions = host.getCompilerOptions();
|
||||
var languageVersion = compilerOptions.target || ScriptTarget.ES3;
|
||||
var sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined;
|
||||
@ -1541,19 +1542,8 @@ module ts {
|
||||
// Sort and make the unique list of diagnostics
|
||||
diagnostics = sortAndDeduplicateDiagnostics(diagnostics);
|
||||
|
||||
// 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 emitResultStatus: EmitReturnStatus;
|
||||
if (hasEmitterError) {
|
||||
emitResultStatus = EmitReturnStatus.EmitErrorsEncountered;
|
||||
} else {
|
||||
emitResultStatus = EmitReturnStatus.Succeeded;
|
||||
}
|
||||
|
||||
return {
|
||||
emitResultStatus,
|
||||
emitSkipped: false,
|
||||
diagnostics,
|
||||
sourceMaps: sourceMapDataList
|
||||
};
|
||||
|
||||
@ -174,20 +174,20 @@ module ts {
|
||||
// If the noEmitOnError flag is set, then check if we have any errors so far. If so,
|
||||
// immediately bail out.
|
||||
if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) {
|
||||
return { diagnostics: [], sourceMaps: undefined, emitResultStatus: EmitReturnStatus.DiagnosticsPresent_AllOutputsSkipped };
|
||||
return { diagnostics: [], sourceMaps: undefined, emitSkipped: true };
|
||||
}
|
||||
|
||||
var start = new Date().getTime();
|
||||
|
||||
var result = emitFiles(
|
||||
var emitResult = emitFiles(
|
||||
getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile),
|
||||
getEmitHost(writeFileCallback),
|
||||
sourceFile);
|
||||
|
||||
emitTime += new Date().getTime() - start;
|
||||
return result;
|
||||
return emitResult;
|
||||
}
|
||||
|
||||
|
||||
function getSourceFile(fileName: string) {
|
||||
fileName = host.getCanonicalFileName(fileName);
|
||||
return hasProperty(filesByName, fileName) ? filesByName[fileName] : undefined;
|
||||
|
||||
@ -165,7 +165,7 @@ module ts {
|
||||
if (commandLine.options.locale) {
|
||||
if (!isJSONSupported()) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--locale"));
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors);
|
||||
}
|
||||
@ -174,29 +174,29 @@ module ts {
|
||||
// setting up localization, report them and quit.
|
||||
if (commandLine.errors.length > 0) {
|
||||
reportDiagnostics(commandLine.errors);
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
|
||||
if (commandLine.options.version) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Version_0, version));
|
||||
return sys.exit(EmitReturnStatus.Succeeded);
|
||||
return sys.exit(ExitStatus.Success);
|
||||
}
|
||||
|
||||
if (commandLine.options.help) {
|
||||
printVersion();
|
||||
printHelp();
|
||||
return sys.exit(EmitReturnStatus.Succeeded);
|
||||
return sys.exit(ExitStatus.Success);
|
||||
}
|
||||
|
||||
if (commandLine.options.project) {
|
||||
if (!isJSONSupported()) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--project"));
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
configFileName = normalizePath(combinePaths(commandLine.options.project, "tsconfig.json"));
|
||||
if (commandLine.fileNames.length !== 0) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_project_cannot_be_mixed_with_source_files_on_a_command_line));
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
}
|
||||
else if (commandLine.fileNames.length === 0 && isJSONSupported()) {
|
||||
@ -206,13 +206,13 @@ module ts {
|
||||
if (commandLine.fileNames.length === 0 && !configFileName) {
|
||||
printVersion();
|
||||
printHelp();
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.Success);
|
||||
}
|
||||
|
||||
if (commandLine.options.watch) {
|
||||
if (!sys.watchFile) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--watch"));
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
if (configFileName) {
|
||||
configFileWatcher = sys.watchFile(configFileName, configFileChanged);
|
||||
@ -229,12 +229,12 @@ module ts {
|
||||
var configObject = readConfigFile(configFileName);
|
||||
if (!configObject) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, configFileName));
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
var configParseResult = parseConfigFile(configObject, getDirectoryPath(configFileName));
|
||||
if (configParseResult.errors.length > 0) {
|
||||
reportDiagnostics(configParseResult.errors);
|
||||
return sys.exit(EmitReturnStatus.CompilerOptionsErrors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
rootFileNames = configParseResult.fileNames;
|
||||
compilerOptions = extend(commandLine.options, configParseResult.options);
|
||||
@ -362,33 +362,46 @@ module ts {
|
||||
|
||||
return { program, exitStatus };
|
||||
|
||||
function compileProgram(): EmitReturnStatus {
|
||||
function compileProgram(): ExitStatus {
|
||||
// First get any syntactic errors.
|
||||
var errors = program.getSyntacticDiagnostics();
|
||||
reportDiagnostics(errors);
|
||||
var diagnostics = program.getSyntacticDiagnostics();
|
||||
reportDiagnostics(diagnostics);
|
||||
|
||||
// If we didn't have any syntactic errors, then also try getting the global and
|
||||
// semantic errors.
|
||||
if (errors.length === 0) {
|
||||
var errors = program.getGlobalDiagnostics();
|
||||
reportDiagnostics(errors);
|
||||
if (diagnostics.length === 0) {
|
||||
var diagnostics = program.getGlobalDiagnostics();
|
||||
reportDiagnostics(diagnostics);
|
||||
|
||||
if (errors.length === 0) {
|
||||
var errors = program.getSemanticDiagnostics();
|
||||
reportDiagnostics(errors);
|
||||
if (diagnostics.length === 0) {
|
||||
var diagnostics = program.getSemanticDiagnostics();
|
||||
reportDiagnostics(diagnostics);
|
||||
}
|
||||
}
|
||||
|
||||
// If the user doesn't want us to emit, then we're done at this point.
|
||||
if (compilerOptions.noEmit) {
|
||||
return EmitReturnStatus.Succeeded;
|
||||
return diagnostics.length
|
||||
? ExitStatus.DiagnosticsPresent_OutputsSkipped
|
||||
: ExitStatus.Success;
|
||||
}
|
||||
|
||||
// Otherwise, emit and report any errors we ran into.
|
||||
var emitOutput = program.emit();
|
||||
reportDiagnostics(emitOutput.diagnostics);
|
||||
|
||||
return emitOutput.emitResultStatus;
|
||||
// If the emitter didn't emit anything, then pass that value along.
|
||||
if (emitOutput.emitSkipped) {
|
||||
return ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
}
|
||||
|
||||
// The emitter emitted something, inform the caller if that happened in the presence
|
||||
// of diagnostics or not.
|
||||
if (diagnostics.length > 0 || emitOutput.diagnostics.length > 0) {
|
||||
ExitStatus.DiagnosticsPresent_OutputsGenerated;
|
||||
}
|
||||
|
||||
return ExitStatus.Success;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -981,31 +981,21 @@ module ts {
|
||||
}
|
||||
|
||||
// Return code used by getEmitOutput function to indicate status of the function
|
||||
export enum EmitReturnStatus {
|
||||
// All outputs generated if requested (.js, .map, .d.ts), no errors reported
|
||||
Succeeded = 0,
|
||||
export enum ExitStatus {
|
||||
// Compiler ran successfully. Either this was a simple do-nothing compilation (for example,
|
||||
// when -version or -help was provided, or this was a normal compilation, no diagnostics
|
||||
// were produced, and all outputs were generated successfully.
|
||||
Success = 0,
|
||||
|
||||
// No .js, .map or d.ts generated because of diagnostics and the presence of the
|
||||
// -noEmitOnError optoin.
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
// Diagnostics were produced and because of them no code was generated.
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
|
||||
// .js and .map generated. However, diagnostics were generated as well.
|
||||
// No .d.ts was requested or generated.
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
|
||||
// .js, .map generated. .d.ts was requested but was not generated due to the
|
||||
// presence of diagnostics.
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
|
||||
// Emitter errors occurred during emitting process.
|
||||
EmitErrorsEncountered = 4,
|
||||
|
||||
// Errors occurred in parsing compiler options, nothing generated
|
||||
CompilerOptionsErrors = 5,
|
||||
// Diagnostics were produced and outputs were generated in spite of them.
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
}
|
||||
|
||||
export interface EmitResult {
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps
|
||||
}
|
||||
|
||||
@ -1140,11 +1140,10 @@ module FourSlash {
|
||||
// Loop through all the emittedFiles and emit them one by one
|
||||
emitFiles.forEach(emitFile => {
|
||||
var emitOutput = this.languageService.getEmitOutput(emitFile.fileName);
|
||||
var emitOutputStatus = emitOutput.emitOutputStatus;
|
||||
// Print emitOutputStatus in readable format
|
||||
resultString += "EmitOutputStatus : " + ts.EmitReturnStatus[emitOutputStatus] + ts.sys.newLine;
|
||||
resultString += "EmitSkipped: " + emitOutput.emitSkipped + ts.sys.newLine;
|
||||
|
||||
if (emitOutputStatus !== ts.EmitReturnStatus.Succeeded) {
|
||||
if (emitOutput.emitSkipped) {
|
||||
resultString += "Diagnostics:" + ts.sys.newLine;
|
||||
var diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram());
|
||||
for (var i = 0, n = diagnostics.length; i < n; i++) {
|
||||
|
||||
@ -1122,7 +1122,7 @@ module ts {
|
||||
|
||||
export interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
|
||||
export const enum OutputFileType {
|
||||
@ -4664,7 +4664,7 @@ module ts {
|
||||
|
||||
return {
|
||||
outputFiles,
|
||||
emitOutputStatus: emitOutput.emitResultStatus
|
||||
emitSkipped: emitOutput.emitSkipped
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -25,8 +25,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void
|
||||
console.log(`${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`);
|
||||
});
|
||||
|
||||
console.log(`Process exiting with code '${emitResult.emitResultStatus}'.`);
|
||||
process.exit(emitResult.emitResultStatus);
|
||||
var exitCode = emitResult.emitSkipped ? 1 : 0;
|
||||
console.log(`Process exiting with code '${exitCode}'.`);
|
||||
process.exit(exitCode);
|
||||
}
|
||||
|
||||
compile(process.argv.slice(2), {
|
||||
@ -777,16 +778,13 @@ declare module "typescript" {
|
||||
sourceMapMappings: string;
|
||||
sourceMapDecodedMappings: SourceMapSpan[];
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
Succeeded = 0,
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
EmitErrorsEncountered = 4,
|
||||
CompilerOptionsErrors = 5,
|
||||
enum ExitStatus {
|
||||
Success = 0,
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
}
|
||||
interface EmitResult {
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
}
|
||||
@ -1723,7 +1721,7 @@ declare module "typescript" {
|
||||
}
|
||||
interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
const enum OutputFileType {
|
||||
JavaScript = 0,
|
||||
@ -1926,8 +1924,9 @@ function compile(fileNames, options) {
|
||||
var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
|
||||
console.log(diagnostic.file.fileName + " (" + lineChar.line + "," + lineChar.character + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL));
|
||||
});
|
||||
console.log("Process exiting with code '" + emitResult.emitResultStatus + "'.");
|
||||
process.exit(emitResult.emitResultStatus);
|
||||
var exitCode = emitResult.emitSkipped ? 1 : 0;
|
||||
console.log("Process exiting with code '" + exitCode + "'.");
|
||||
process.exit(exitCode);
|
||||
}
|
||||
exports.compile = compile;
|
||||
compile(process.argv.slice(2), {
|
||||
|
||||
@ -104,23 +104,26 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void
|
||||
|
||||
});
|
||||
|
||||
console.log(`Process exiting with code '${emitResult.emitResultStatus}'.`);
|
||||
>console.log(`Process exiting with code '${emitResult.emitResultStatus}'.`) : any
|
||||
var exitCode = emitResult.emitSkipped ? 1 : 0;
|
||||
>exitCode : number
|
||||
>emitResult.emitSkipped ? 1 : 0 : number
|
||||
>emitResult.emitSkipped : boolean
|
||||
>emitResult : ts.EmitResult
|
||||
>emitSkipped : boolean
|
||||
|
||||
console.log(`Process exiting with code '${exitCode}'.`);
|
||||
>console.log(`Process exiting with code '${exitCode}'.`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>emitResult.emitResultStatus : ts.EmitReturnStatus
|
||||
>emitResult : ts.EmitResult
|
||||
>emitResultStatus : ts.EmitReturnStatus
|
||||
>exitCode : number
|
||||
|
||||
process.exit(emitResult.emitResultStatus);
|
||||
>process.exit(emitResult.emitResultStatus) : any
|
||||
process.exit(exitCode);
|
||||
>process.exit(exitCode) : any
|
||||
>process.exit : any
|
||||
>process : any
|
||||
>exit : any
|
||||
>emitResult.emitResultStatus : ts.EmitReturnStatus
|
||||
>emitResult : ts.EmitResult
|
||||
>emitResultStatus : ts.EmitReturnStatus
|
||||
>exitCode : number
|
||||
}
|
||||
|
||||
compile(process.argv.slice(2), {
|
||||
@ -2349,33 +2352,23 @@ declare module "typescript" {
|
||||
>sourceMapDecodedMappings : SourceMapSpan[]
|
||||
>SourceMapSpan : SourceMapSpan
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
enum ExitStatus {
|
||||
>ExitStatus : ExitStatus
|
||||
|
||||
Succeeded = 0,
|
||||
>Succeeded : EmitReturnStatus
|
||||
Success = 0,
|
||||
>Success : ExitStatus
|
||||
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
>DiagnosticsPresent_AllOutputsSkipped : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
>DiagnosticsPresent_OutputsSkipped : ExitStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
>DiagnosticsPresent_JavaScriptGenerated : EmitReturnStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
>DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated : EmitReturnStatus
|
||||
|
||||
EmitErrorsEncountered = 4,
|
||||
>EmitErrorsEncountered : EmitReturnStatus
|
||||
|
||||
CompilerOptionsErrors = 5,
|
||||
>CompilerOptionsErrors : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
>DiagnosticsPresent_OutputsGenerated : ExitStatus
|
||||
}
|
||||
interface EmitResult {
|
||||
>EmitResult : EmitResult
|
||||
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
>emitResultStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
|
||||
diagnostics: Diagnostic[];
|
||||
>diagnostics : Diagnostic[]
|
||||
@ -5496,9 +5489,8 @@ declare module "typescript" {
|
||||
>outputFiles : OutputFile[]
|
||||
>OutputFile : OutputFile
|
||||
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
>emitOutputStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
}
|
||||
const enum OutputFileType {
|
||||
>OutputFileType : OutputFileType
|
||||
|
||||
@ -809,16 +809,13 @@ declare module "typescript" {
|
||||
sourceMapMappings: string;
|
||||
sourceMapDecodedMappings: SourceMapSpan[];
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
Succeeded = 0,
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
EmitErrorsEncountered = 4,
|
||||
CompilerOptionsErrors = 5,
|
||||
enum ExitStatus {
|
||||
Success = 0,
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
}
|
||||
interface EmitResult {
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
}
|
||||
@ -1755,7 +1752,7 @@ declare module "typescript" {
|
||||
}
|
||||
interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
const enum OutputFileType {
|
||||
JavaScript = 0,
|
||||
|
||||
@ -2496,33 +2496,23 @@ declare module "typescript" {
|
||||
>sourceMapDecodedMappings : SourceMapSpan[]
|
||||
>SourceMapSpan : SourceMapSpan
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
enum ExitStatus {
|
||||
>ExitStatus : ExitStatus
|
||||
|
||||
Succeeded = 0,
|
||||
>Succeeded : EmitReturnStatus
|
||||
Success = 0,
|
||||
>Success : ExitStatus
|
||||
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
>DiagnosticsPresent_AllOutputsSkipped : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
>DiagnosticsPresent_OutputsSkipped : ExitStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
>DiagnosticsPresent_JavaScriptGenerated : EmitReturnStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
>DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated : EmitReturnStatus
|
||||
|
||||
EmitErrorsEncountered = 4,
|
||||
>EmitErrorsEncountered : EmitReturnStatus
|
||||
|
||||
CompilerOptionsErrors = 5,
|
||||
>CompilerOptionsErrors : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
>DiagnosticsPresent_OutputsGenerated : ExitStatus
|
||||
}
|
||||
interface EmitResult {
|
||||
>EmitResult : EmitResult
|
||||
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
>emitResultStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
|
||||
diagnostics: Diagnostic[];
|
||||
>diagnostics : Diagnostic[]
|
||||
@ -5643,9 +5633,8 @@ declare module "typescript" {
|
||||
>outputFiles : OutputFile[]
|
||||
>OutputFile : OutputFile
|
||||
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
>emitOutputStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
}
|
||||
const enum OutputFileType {
|
||||
>OutputFileType : OutputFileType
|
||||
|
||||
@ -810,16 +810,13 @@ declare module "typescript" {
|
||||
sourceMapMappings: string;
|
||||
sourceMapDecodedMappings: SourceMapSpan[];
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
Succeeded = 0,
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
EmitErrorsEncountered = 4,
|
||||
CompilerOptionsErrors = 5,
|
||||
enum ExitStatus {
|
||||
Success = 0,
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
}
|
||||
interface EmitResult {
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
}
|
||||
@ -1756,7 +1753,7 @@ declare module "typescript" {
|
||||
}
|
||||
interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
const enum OutputFileType {
|
||||
JavaScript = 0,
|
||||
|
||||
@ -2448,33 +2448,23 @@ declare module "typescript" {
|
||||
>sourceMapDecodedMappings : SourceMapSpan[]
|
||||
>SourceMapSpan : SourceMapSpan
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
enum ExitStatus {
|
||||
>ExitStatus : ExitStatus
|
||||
|
||||
Succeeded = 0,
|
||||
>Succeeded : EmitReturnStatus
|
||||
Success = 0,
|
||||
>Success : ExitStatus
|
||||
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
>DiagnosticsPresent_AllOutputsSkipped : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
>DiagnosticsPresent_OutputsSkipped : ExitStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
>DiagnosticsPresent_JavaScriptGenerated : EmitReturnStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
>DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated : EmitReturnStatus
|
||||
|
||||
EmitErrorsEncountered = 4,
|
||||
>EmitErrorsEncountered : EmitReturnStatus
|
||||
|
||||
CompilerOptionsErrors = 5,
|
||||
>CompilerOptionsErrors : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
>DiagnosticsPresent_OutputsGenerated : ExitStatus
|
||||
}
|
||||
interface EmitResult {
|
||||
>EmitResult : EmitResult
|
||||
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
>emitResultStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
|
||||
diagnostics: Diagnostic[];
|
||||
>diagnostics : Diagnostic[]
|
||||
@ -5595,9 +5585,8 @@ declare module "typescript" {
|
||||
>outputFiles : OutputFile[]
|
||||
>OutputFile : OutputFile
|
||||
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
>emitOutputStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
}
|
||||
const enum OutputFileType {
|
||||
>OutputFileType : OutputFileType
|
||||
|
||||
@ -67,7 +67,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
function emitFile(fileName: string) {
|
||||
var output = services.getEmitOutput(fileName);
|
||||
|
||||
if (output.emitOutputStatus === ts.EmitReturnStatus.Succeeded) {
|
||||
if (!output.emitSkipped) {
|
||||
console.log(`Emitting ${fileName}`);
|
||||
}
|
||||
else {
|
||||
@ -88,7 +88,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
if (diagnostic.file) {
|
||||
var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`);
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`);
|
||||
}
|
||||
else {
|
||||
console.log(` Error: ${diagnostic.messageText}`);
|
||||
@ -847,16 +847,13 @@ declare module "typescript" {
|
||||
sourceMapMappings: string;
|
||||
sourceMapDecodedMappings: SourceMapSpan[];
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
Succeeded = 0,
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
EmitErrorsEncountered = 4,
|
||||
CompilerOptionsErrors = 5,
|
||||
enum ExitStatus {
|
||||
Success = 0,
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
}
|
||||
interface EmitResult {
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
}
|
||||
@ -1793,7 +1790,7 @@ declare module "typescript" {
|
||||
}
|
||||
interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
const enum OutputFileType {
|
||||
JavaScript = 0,
|
||||
@ -2028,7 +2025,7 @@ function watch(rootFileNames, options) {
|
||||
});
|
||||
function emitFile(fileName) {
|
||||
var output = services.getEmitOutput(fileName);
|
||||
if (output.emitOutputStatus === 0 /* Succeeded */) {
|
||||
if (!output.emitSkipped) {
|
||||
console.log("Emitting " + fileName);
|
||||
}
|
||||
else {
|
||||
@ -2044,7 +2041,7 @@ function watch(rootFileNames, options) {
|
||||
allDiagnostics.forEach(function (diagnostic) {
|
||||
if (diagnostic.file) {
|
||||
var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
|
||||
console.log(" Error " + diagnostic.file.fileName + " (" + lineChar.line + "," + lineChar.character + "): " + diagnostic.messageText);
|
||||
console.log(" Error " + diagnostic.file.fileName + " (" + lineChar.line + "," + lineChar.character + "): " + ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
||||
}
|
||||
else {
|
||||
console.log(" Error: " + diagnostic.messageText);
|
||||
|
||||
@ -233,16 +233,11 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
>getEmitOutput : (fileName: string) => ts.EmitOutput
|
||||
>fileName : string
|
||||
|
||||
if (output.emitOutputStatus === ts.EmitReturnStatus.Succeeded) {
|
||||
>output.emitOutputStatus === ts.EmitReturnStatus.Succeeded : boolean
|
||||
>output.emitOutputStatus : ts.EmitReturnStatus
|
||||
if (!output.emitSkipped) {
|
||||
>!output.emitSkipped : boolean
|
||||
>output.emitSkipped : boolean
|
||||
>output : ts.EmitOutput
|
||||
>emitOutputStatus : ts.EmitReturnStatus
|
||||
>ts.EmitReturnStatus.Succeeded : ts.EmitReturnStatus
|
||||
>ts.EmitReturnStatus : typeof ts.EmitReturnStatus
|
||||
>ts : typeof ts
|
||||
>EmitReturnStatus : typeof ts.EmitReturnStatus
|
||||
>Succeeded : ts.EmitReturnStatus
|
||||
>emitSkipped : boolean
|
||||
|
||||
console.log(`Emitting ${fileName}`);
|
||||
>console.log(`Emitting ${fileName}`) : any
|
||||
@ -322,11 +317,11 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
>fileName : string
|
||||
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
>allDiagnostics.forEach(diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`); } else { console.log(` Error: ${diagnostic.messageText}`); } }) : void
|
||||
>allDiagnostics.forEach(diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } }) : void
|
||||
>allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>allDiagnostics : ts.Diagnostic[]
|
||||
>forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void
|
||||
>diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`); } else { console.log(` Error: ${diagnostic.messageText}`); } } : (diagnostic: ts.Diagnostic) => void
|
||||
>diagnostic => { if (diagnostic.file) { var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`); } else { console.log(` Error: ${diagnostic.messageText}`); } } : (diagnostic: ts.Diagnostic) => void
|
||||
>diagnostic : ts.Diagnostic
|
||||
|
||||
if (diagnostic.file) {
|
||||
@ -346,8 +341,8 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
>diagnostic : ts.Diagnostic
|
||||
>start : number
|
||||
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`);
|
||||
>console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`) : any
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`);
|
||||
>console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
@ -362,6 +357,10 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
>lineChar.character : number
|
||||
>lineChar : ts.LineAndCharacter
|
||||
>character : number
|
||||
>ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string
|
||||
>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>ts : typeof ts
|
||||
>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string
|
||||
>diagnostic.messageText : string | ts.DiagnosticMessageChain
|
||||
>diagnostic : ts.Diagnostic
|
||||
>messageText : string | ts.DiagnosticMessageChain
|
||||
@ -2622,33 +2621,23 @@ declare module "typescript" {
|
||||
>sourceMapDecodedMappings : SourceMapSpan[]
|
||||
>SourceMapSpan : SourceMapSpan
|
||||
}
|
||||
enum EmitReturnStatus {
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
enum ExitStatus {
|
||||
>ExitStatus : ExitStatus
|
||||
|
||||
Succeeded = 0,
|
||||
>Succeeded : EmitReturnStatus
|
||||
Success = 0,
|
||||
>Success : ExitStatus
|
||||
|
||||
DiagnosticsPresent_AllOutputsSkipped = 1,
|
||||
>DiagnosticsPresent_AllOutputsSkipped : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsSkipped = 1,
|
||||
>DiagnosticsPresent_OutputsSkipped : ExitStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated = 2,
|
||||
>DiagnosticsPresent_JavaScriptGenerated : EmitReturnStatus
|
||||
|
||||
DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated = 3,
|
||||
>DiagnosticsPresent_JavaScriptGenerated_DeclarationNotGenerated : EmitReturnStatus
|
||||
|
||||
EmitErrorsEncountered = 4,
|
||||
>EmitErrorsEncountered : EmitReturnStatus
|
||||
|
||||
CompilerOptionsErrors = 5,
|
||||
>CompilerOptionsErrors : EmitReturnStatus
|
||||
DiagnosticsPresent_OutputsGenerated = 2,
|
||||
>DiagnosticsPresent_OutputsGenerated : ExitStatus
|
||||
}
|
||||
interface EmitResult {
|
||||
>EmitResult : EmitResult
|
||||
|
||||
emitResultStatus: EmitReturnStatus;
|
||||
>emitResultStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
|
||||
diagnostics: Diagnostic[];
|
||||
>diagnostics : Diagnostic[]
|
||||
@ -5769,9 +5758,8 @@ declare module "typescript" {
|
||||
>outputFiles : OutputFile[]
|
||||
>OutputFile : OutputFile
|
||||
|
||||
emitOutputStatus: EmitReturnStatus;
|
||||
>emitOutputStatus : EmitReturnStatus
|
||||
>EmitReturnStatus : EmitReturnStatus
|
||||
emitSkipped: boolean;
|
||||
>emitSkipped : boolean
|
||||
}
|
||||
const enum OutputFileType {
|
||||
>OutputFileType : OutputFileType
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js
|
||||
var x = 5;
|
||||
var Bar = (function () {
|
||||
@ -13,7 +13,7 @@ declare class Bar {
|
||||
y: number;
|
||||
}
|
||||
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.js
|
||||
var x1 = "hello world";
|
||||
var Foo = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : declSingleFile.js
|
||||
var x = 5;
|
||||
var Bar = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : declSingleFile.js
|
||||
var x = 5;
|
||||
var Bar = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : declSingleFile.js
|
||||
var x = 5;
|
||||
var Bar = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : declSingleFile.js.map
|
||||
{"version":3,"file":"declSingleFile.js","sourceRoot":"","sources":["../tests/cases/fourslash/inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : declSingleFile.js
|
||||
var x = 109;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
var x;
|
||||
var M = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.js
|
||||
var x;
|
||||
var Foo = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : outputDir/singleFile.js
|
||||
var x;
|
||||
var Bar = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile3.js
|
||||
exports.foo = 10;
|
||||
exports.bar = "hello world";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js.map
|
||||
{"version":3,"file":"inputFile.js","sourceRoot":"","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
|
||||
var x = 109;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : sample/outDir/inputFile1.js.map
|
||||
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : sample/outDir/inputFile1.js
|
||||
var x = 109;
|
||||
@ -9,7 +9,7 @@ var M = (function () {
|
||||
return M;
|
||||
})();
|
||||
//# sourceMappingURL=inputFile1.js.map
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : sample/outDir/inputFile2.js.map
|
||||
{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,EAAE,CAAC;AACd,CAAC"}FileName : sample/outDir/inputFile2.js
|
||||
var intro = "hello world";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js.map
|
||||
{"version":3,"file":"inputFile.js","sourceRoot":"sourceRootDir/","sources":["inputFile.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile.js
|
||||
var x = 109;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js.map
|
||||
{"version":3,"file":"inputFile1.js","sourceRoot":"sourceRootDir/","sources":["inputFile1.ts"],"names":["M","M.constructor"],"mappings":"AAAA,IAAI,CAAC,GAAG,GAAG,CAAC;AACZ,IAAI,GAAG,GAAG,aAAa,CAAC;AACxB,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile1.js
|
||||
var x = 109;
|
||||
@ -9,7 +9,7 @@ var M = (function () {
|
||||
return M;
|
||||
})();
|
||||
//# sourceMappingURL=inputFile1.js.map
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.js.map
|
||||
{"version":3,"file":"inputFile2.js","sourceRoot":"sourceRootDir/","sources":["inputFile2.ts"],"names":["C","C.constructor"],"mappings":"AAAA,IAAI,GAAG,GAAG,wBAAwB,CAAC;AACnC,IAAM,CAAC;IAAPA,SAAMA,CAACA;IAGPC,CAACA;IAADD,QAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile2.js
|
||||
var bar = "hello world Typescript";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.js
|
||||
var x1 = "hello world";
|
||||
var Foo = (function () {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.js
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
@ -9,7 +9,7 @@ var Foo = (function () {
|
||||
})();
|
||||
exports.Foo = Foo;
|
||||
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile3.js
|
||||
var x = "hello";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : declSingle.js
|
||||
var x = "hello";
|
||||
var x1 = 1000;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js
|
||||
// File contains early errors. All outputs should be skipped.
|
||||
const uninitialized_const_error;
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EmitOutputStatus : EmitErrorsEncountered
|
||||
Diagnostics:
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
var M;
|
||||
(function (M) {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EmitOutputStatus : EmitErrorsEncountered
|
||||
Diagnostics:
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
var C = (function () {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
var x = "hello world";
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
var x = "hello world";
|
||||
FileName : tests/cases/fourslash/inputFile.d.ts
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js
|
||||
// File to emit, does not contain semantic errors
|
||||
// expected to be emitted correctelly regardless of the semantic errors in the other file
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : out.js
|
||||
// File to emit, does not contain semantic errors, but --out is passed
|
||||
// expected to not generate declarations because of the semantic errors in the other file
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js
|
||||
// File to emit, does not contain syntactic errors
|
||||
// expected to be emitted correctelly regardless of the syntactic errors in the other file
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : out.js
|
||||
// File to emit, does not contain syntactic errors, but --out is passed
|
||||
// expected to not generate outputs because of the syntactic errors in the other file.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
EmitOutputStatus : Succeeded
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile.js
|
||||
var x;
|
||||
|
||||
|
||||
@ -25,8 +25,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void
|
||||
console.log(`${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, os.EOL)}`);
|
||||
});
|
||||
|
||||
console.log(`Process exiting with code '${emitResult.emitResultStatus}'.`);
|
||||
process.exit(emitResult.emitResultStatus);
|
||||
var exitCode = emitResult.emitSkipped ? 1 : 0;
|
||||
console.log(`Process exiting with code '${exitCode}'.`);
|
||||
process.exit(exitCode);
|
||||
}
|
||||
|
||||
compile(process.argv.slice(2), {
|
||||
|
||||
@ -67,7 +67,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
function emitFile(fileName: string) {
|
||||
var output = services.getEmitOutput(fileName);
|
||||
|
||||
if (output.emitOutputStatus === ts.EmitReturnStatus.Succeeded) {
|
||||
if (!output.emitSkipped) {
|
||||
console.log(`Emitting ${fileName}`);
|
||||
}
|
||||
else {
|
||||
@ -88,7 +88,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
if (diagnostic.file) {
|
||||
var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${diagnostic.messageText}`);
|
||||
console.log(` Error ${diagnostic.file.fileName} (${lineChar.line},${lineChar.character}): ${ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n")}`);
|
||||
}
|
||||
else {
|
||||
console.log(` Error: ${diagnostic.messageText}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user