mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Merge branch 'master' into layering
Conflicts: src/compiler/parser.ts
This commit is contained in:
@@ -88,6 +88,7 @@ module ts {
|
||||
verifyCompilerOptions();
|
||||
errors.sort(compareDiagnostics);
|
||||
|
||||
|
||||
var diagnosticsProducingTypeChecker: TypeChecker;
|
||||
var noDiagnosticsTypeChecker: TypeChecker;
|
||||
var emitHost: EmitHost;
|
||||
@@ -145,9 +146,7 @@ module ts {
|
||||
function invokeEmitter(targetSourceFile?: SourceFile) {
|
||||
var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver();
|
||||
return emitFiles(resolver, getEmitHost(), targetSourceFile);
|
||||
}
|
||||
|
||||
function getSourceFile(filename: string) {
|
||||
} function getSourceFile(filename: string) {
|
||||
filename = host.getCanonicalFileName(filename);
|
||||
return hasProperty(filesByName, filename) ? filesByName[filename] : undefined;
|
||||
}
|
||||
@@ -218,8 +217,13 @@ module ts {
|
||||
|
||||
// We haven't looked for this file, do so now and cache result
|
||||
var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, hostErrorMessage => {
|
||||
errors.push(createFileDiagnostic(refFile, refStart, refLength,
|
||||
Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage));
|
||||
if (refFile) {
|
||||
errors.push(createFileDiagnostic(refFile, refStart, refLength,
|
||||
Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage));
|
||||
}
|
||||
else {
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage));
|
||||
}
|
||||
});
|
||||
if (file) {
|
||||
seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib;
|
||||
@@ -389,6 +393,16 @@ module ts {
|
||||
commonSourceDirectory += directorySeparator;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.noEmit) {
|
||||
if (options.out || options.outDir) {
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_out_or_outDir));
|
||||
}
|
||||
|
||||
if (options.declaration) {
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user