merged with master

This commit is contained in:
Arthur Ozga
2015-07-31 10:03:48 -07:00
165 changed files with 4977 additions and 1600 deletions
+28
View File
@@ -2488,6 +2488,17 @@ module FourSlash {
}
}
// @Filename is the only directive that can be used in a test that contains tsconfig.json file.
if (containTSConfigJson(files)) {
let directive = getNonFileNameOptionInFileList(files);
if (!directive) {
directive = getNonFileNameOptionInObject(globalOptions);
}
if (directive) {
throw Error("It is not allowed to use tsconfig.json along with directive '" + directive + "'");
}
}
return {
markerPositions,
markers,
@@ -2497,6 +2508,23 @@ module FourSlash {
};
}
function containTSConfigJson(files: FourSlashFile[]): boolean {
return ts.forEach(files, f => f.fileOptions['Filename'] === 'tsconfig.json');
}
function getNonFileNameOptionInFileList(files: FourSlashFile[]): string {
return ts.forEach(files, f => getNonFileNameOptionInObject(f.fileOptions));
}
function getNonFileNameOptionInObject(optionObject: { [s: string]: string }): string {
for (let option in optionObject) {
if (option !== metadataOptionNames.fileName) {
return option;
}
}
return undefined;
}
const enum State {
none,
inSlashStarMarker,
+3 -3
View File
@@ -493,7 +493,7 @@ module Harness {
export let readFile: typeof IO.readFile = ts.sys.readFile;
export let writeFile: typeof IO.writeFile = ts.sys.writeFile;
export let fileExists: typeof IO.fileExists = fs.existsSync;
export let log: typeof IO.log = console.log;
export let log: typeof IO.log = s => console.log(s);
export function createDirectory(path: string) {
if (!directoryExists(path)) {
@@ -673,7 +673,7 @@ module Harness {
};
export let listFiles = Utils.memoize(_listFilesImpl);
export let log = console.log;
export let log = (s: string) => console.log(s);
export function readFile(file: string) {
let response = Http.getFileFromServerSync(serverRoot + file);
@@ -1451,7 +1451,7 @@ module Harness {
}
export function isJSMap(fileName: string) {
return stringEndsWith(fileName, '.js.map');
return stringEndsWith(fileName, '.js.map') || stringEndsWith(fileName, '.jsx.map');
}
/** Contains the code and errors of a compilation and some helper methods to check its status. */