Merge branch 'master' into release-1.5

Conflicts:
	bin/tsc.js
	bin/tsserver.js
	bin/typescript.js
	bin/typescriptServices.js
	src/compiler/checker.ts
	src/compiler/emitter.ts
	src/services/services.ts
	src/services/shims.ts
	tests/baselines/reference/classExpressionWithDecorator1.js
	tests/baselines/reference/decoratedClassFromExternalModule.js
	tests/baselines/reference/decoratorOnClass1.js
	tests/baselines/reference/decoratorOnClass2.js
	tests/baselines/reference/decoratorOnClass3.js
	tests/baselines/reference/decoratorOnClass4.js
	tests/baselines/reference/decoratorOnClass5.js
	tests/baselines/reference/decoratorOnClass8.js
	tests/baselines/reference/decoratorOnClassAccessor1.js
	tests/baselines/reference/decoratorOnClassAccessor2.js
	tests/baselines/reference/decoratorOnClassAccessor3.js
	tests/baselines/reference/decoratorOnClassAccessor4.js
	tests/baselines/reference/decoratorOnClassAccessor5.js
	tests/baselines/reference/decoratorOnClassAccessor6.js
	tests/baselines/reference/decoratorOnClassConstructorParameter1.js
	tests/baselines/reference/decoratorOnClassConstructorParameter4.js
	tests/baselines/reference/decoratorOnClassMethod1.js
	tests/baselines/reference/decoratorOnClassMethod10.js
	tests/baselines/reference/decoratorOnClassMethod11.js
	tests/baselines/reference/decoratorOnClassMethod12.js
	tests/baselines/reference/decoratorOnClassMethod13.js
	tests/baselines/reference/decoratorOnClassMethod2.js
	tests/baselines/reference/decoratorOnClassMethod3.js
	tests/baselines/reference/decoratorOnClassMethod4.js
	tests/baselines/reference/decoratorOnClassMethod5.js
	tests/baselines/reference/decoratorOnClassMethod6.js
	tests/baselines/reference/decoratorOnClassMethod7.js
	tests/baselines/reference/decoratorOnClassMethod8.js
	tests/baselines/reference/decoratorOnClassMethodParameter1.js
	tests/baselines/reference/decoratorOnClassProperty1.js
	tests/baselines/reference/decoratorOnClassProperty10.js
	tests/baselines/reference/decoratorOnClassProperty11.js
	tests/baselines/reference/decoratorOnClassProperty2.js
	tests/baselines/reference/decoratorOnClassProperty3.js
	tests/baselines/reference/decoratorOnClassProperty6.js
	tests/baselines/reference/decoratorOnClassProperty7.js
	tests/baselines/reference/missingDecoratorType.js
	tests/baselines/reference/sourceMapValidationDecorators.js
	tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt
This commit is contained in:
Mohamed Hegazy committed 2015-05-06 22:36:01 -07:00
commit 60b7bbb6c5
1676 files changed
+42861 -22058

No files matched your search

+34 -7
View File
@@ -10,6 +10,9 @@ module ts {
/** The version of the TypeScript compiler release */
export const version = "1.5.0-beta";
const carriageReturnLineFeed = "\r\n";
const lineFeed = "\n";
export function findConfigFile(searchPath: string): string {
var fileName = "tsconfig.json";
while (true) {
@@ -91,6 +94,11 @@ module ts {
}
}
let newLine =
options.newLine === NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed :
options.newLine === NewLineKind.LineFeed ? lineFeed :
sys.newLine;
return {
getSourceFile,
getDefaultLibFileName: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)),
@@ -98,15 +106,15 @@ module ts {
getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()),
useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames,
getCanonicalFileName,
getNewLine: () => sys.newLine
getNewLine: () => newLine
};
}
export function getPreEmitDiagnostics(program: Program): Diagnostic[] {
let diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics());
export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[] {
let diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile));
if (program.getCompilerOptions().declaration) {
diagnostics.concat(program.getDeclarationDiagnostics());
diagnostics.concat(program.getDeclarationDiagnostics(sourceFile));
}
return sortAndDeduplicateDiagnostics(diagnostics);
@@ -534,6 +542,25 @@ module ts {
}
}
if (options.inlineSourceMap) {
if (options.sourceMap) {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap));
}
if (options.mapRoot) {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap));
}
if (options.sourceRoot) {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap));
}
}
if (options.inlineSources) {
if (!options.sourceMap && !options.inlineSourceMap) {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided));
}
}
if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) {
// Error to specify --mapRoot or --sourceRoot without mapSourceFiles
if (options.mapRoot) {
@@ -556,18 +583,18 @@ module ts {
let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
if (firstNonExternalModuleSourceFile) {
let span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided));
diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
}
}
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && !options.module) {
// We cannot use createDiagnosticFromNode because nodes do not have parents yet
let span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided));
diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided));
}
// Cannot specify module gen target when in es6 or above
if (options.module && languageVersion >= ScriptTarget.ES6) {
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher));
}
// there has to be common source directory if user specified --outdir || --sourceRoot