|
2 | 2 | /// <reference path="emitter.ts" />
|
3 | 3 |
|
4 | 4 | module ts {
|
| 5 | + /* @internal */ export var programTime = 0; |
5 | 6 | /* @internal */ export var emitTime = 0;
|
6 | 7 | /* @internal */ export var ioReadTime = 0;
|
| 8 | + /* @internal */ export var ioWriteTime = 0; |
7 | 9 |
|
8 | 10 | /** The version of the TypeScript compiler release */
|
9 | 11 | export var version = "1.5.0.0";
|
@@ -35,33 +37,34 @@ module ts {
|
35 | 37 | }
|
36 | 38 | text = "";
|
37 | 39 | }
|
38 |
| - |
39 | 40 | return text !== undefined ? createSourceFile(fileName, text, languageVersion) : undefined;
|
40 | 41 | }
|
41 | 42 |
|
42 |
| - function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) { |
43 |
| - function directoryExists(directoryPath: string): boolean { |
44 |
| - if (hasProperty(existingDirectories, directoryPath)) { |
45 |
| - return true; |
46 |
| - } |
47 |
| - if (sys.directoryExists(directoryPath)) { |
48 |
| - existingDirectories[directoryPath] = true; |
49 |
| - return true; |
50 |
| - } |
51 |
| - return false; |
| 43 | + function directoryExists(directoryPath: string): boolean { |
| 44 | + if (hasProperty(existingDirectories, directoryPath)) { |
| 45 | + return true; |
| 46 | + } |
| 47 | + if (sys.directoryExists(directoryPath)) { |
| 48 | + existingDirectories[directoryPath] = true; |
| 49 | + return true; |
52 | 50 | }
|
| 51 | + return false; |
| 52 | + } |
53 | 53 |
|
54 |
| - function ensureDirectoriesExist(directoryPath: string) { |
55 |
| - if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { |
56 |
| - var parentDirectory = getDirectoryPath(directoryPath); |
57 |
| - ensureDirectoriesExist(parentDirectory); |
58 |
| - sys.createDirectory(directoryPath); |
59 |
| - } |
| 54 | + function ensureDirectoriesExist(directoryPath: string) { |
| 55 | + if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { |
| 56 | + var parentDirectory = getDirectoryPath(directoryPath); |
| 57 | + ensureDirectoriesExist(parentDirectory); |
| 58 | + sys.createDirectory(directoryPath); |
60 | 59 | }
|
| 60 | + } |
61 | 61 |
|
| 62 | + function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) { |
62 | 63 | try {
|
| 64 | + var start = new Date().getTime(); |
63 | 65 | ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
|
64 | 66 | sys.writeFile(fileName, data, writeByteOrderMark);
|
| 67 | + ioWriteTime += new Date().getTime() - start; |
65 | 68 | }
|
66 | 69 | catch (e) {
|
67 | 70 | if (onError) {
|
@@ -119,16 +122,19 @@ module ts {
|
119 | 122 | var diagnostics = createDiagnosticCollection();
|
120 | 123 | var seenNoDefaultLib = options.noLib;
|
121 | 124 | var commonSourceDirectory: string;
|
| 125 | + var diagnosticsProducingTypeChecker: TypeChecker; |
| 126 | + var noDiagnosticsTypeChecker: TypeChecker; |
| 127 | + |
122 | 128 | host = host || createCompilerHost(options);
|
123 | 129 |
|
| 130 | + var start = new Date().getTime(); |
124 | 131 | forEach(rootNames, name => processRootFile(name, false));
|
125 | 132 | if (!seenNoDefaultLib) {
|
126 | 133 | processRootFile(host.getDefaultLibFileName(options), true);
|
127 | 134 | }
|
128 |
| - verifyCompilerOptions(); |
| 135 | + programTime += new Date().getTime() - start; |
129 | 136 |
|
130 |
| - var diagnosticsProducingTypeChecker: TypeChecker; |
131 |
| - var noDiagnosticsTypeChecker: TypeChecker; |
| 137 | + verifyCompilerOptions(); |
132 | 138 |
|
133 | 139 | program = {
|
134 | 140 | getSourceFile: getSourceFile,
|
|
0 commit comments