mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'init' of https://github.com/tinganho/TypeScript into tinganho-init
Conflicts: src/compiler/diagnosticInformationMap.generated.ts src/compiler/diagnosticMessages.json src/compiler/types.ts
This commit is contained in:
commit
f3d36616b7
8 files changed
+211
-80
No files matched your search
@@ -1,5 +1,6 @@
|
||||
/// <reference path="sys.ts" />
|
||||
/// <reference path="emitter.ts" />
|
||||
/// <reference path="core.ts" />
|
||||
|
||||
namespace ts {
|
||||
/* @internal */ export let programTime = 0;
|
||||
@@ -224,6 +225,50 @@ namespace ts {
|
||||
return { resolvedFileName: referencedSourceFile, failedLookupLocations };
|
||||
}
|
||||
|
||||
export const defaultInitCompilerOptions: CompilerOptions = {
|
||||
module: ModuleKind.CommonJS,
|
||||
target: ScriptTarget.ES3,
|
||||
noImplicitAny: false,
|
||||
outDir: "built",
|
||||
rootDir: ".",
|
||||
sourceMap: false,
|
||||
}
|
||||
|
||||
export function scriptTargetToString(target: ScriptTarget): string {
|
||||
switch (target) {
|
||||
case ScriptTarget.ES5:
|
||||
return "es5";
|
||||
case ScriptTarget.ES6:
|
||||
return "es6";
|
||||
default:
|
||||
return "es3";
|
||||
}
|
||||
}
|
||||
|
||||
export function moduleKindToString(kind: ModuleKind): string {
|
||||
switch (kind) {
|
||||
case ModuleKind.None:
|
||||
return undefined;
|
||||
case ModuleKind.CommonJS:
|
||||
return "commonjs";
|
||||
case ModuleKind.System:
|
||||
return "system";
|
||||
case ModuleKind.UMD:
|
||||
return "umd";
|
||||
default:
|
||||
return "amd";
|
||||
}
|
||||
}
|
||||
|
||||
export function newLineKindToString(kind: NewLineKind): string {
|
||||
switch (kind) {
|
||||
case NewLineKind.CarriageReturnLineFeed:
|
||||
return "CRLF";
|
||||
default:
|
||||
return "LF";
|
||||
}
|
||||
}
|
||||
|
||||
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost {
|
||||
let currentDirectory: string;
|
||||
let existingDirectories: Map<boolean> = {};
|
||||
|
||||
Reference in new issue
Block a user