Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
billti committed Mar 16, 2016
1 parent b23503c commit 9ef7553
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 50 deletions.
58 changes: 47 additions & 11 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1138,15 +1138,18 @@ var ts;
var current = files_2[_i];
var name_3 = ts.combinePaths(path, current);
if (!ts.contains(exclude, getCanonicalPath(name_3))) {
var stat = _fs.statSync(name_3);
if (stat.isFile()) {
if (!extension || ts.fileExtensionIs(name_3, extension)) {
result.push(name_3);
try {
var stat = _fs.statSync(name_3);
if (stat.isFile()) {
if (!extension || ts.fileExtensionIs(name_3, extension)) {
result.push(name_3);
}
}
else if (stat.isDirectory()) {
directories.push(name_3);
}
}
else if (stat.isDirectory()) {
directories.push(name_3);
}
catch (e) { }
}
}
for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) {
Expand Down Expand Up @@ -1924,7 +1927,8 @@ var ts;
A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: { code: 17007, category: ts.DiagnosticCategory.Error, key: "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", message: "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses." },
JSX_element_0_has_no_corresponding_closing_tag: { code: 17008, category: ts.DiagnosticCategory.Error, key: "JSX_element_0_has_no_corresponding_closing_tag_17008", message: "JSX element '{0}' has no corresponding closing tag." },
super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: { code: 17009, category: ts.DiagnosticCategory.Error, key: "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", message: "'super' must be called before accessing 'this' in the constructor of a derived class." },
Unknown_typing_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_typing_option_0_17010", message: "Unknown typing option '{0}'." }
Unknown_typing_option_0: { code: 17010, category: ts.DiagnosticCategory.Error, key: "Unknown_typing_option_0_17010", message: "Unknown typing option '{0}'." },
Too_many_JavaScript_files_in_the_project_Consider_specifying_the_exclude_setting_in_project_configuration_to_limit_included_source_folders_The_likely_folder_to_exclude_is_0_To_disable_the_project_size_limit_set_the_disableSizeLimit_compiler_option_to_true: { code: 17012, category: ts.DiagnosticCategory.Error, key: "Too_many_JavaScript_files_in_the_project_Consider_specifying_the_exclude_setting_in_project_configur_17012", message: "Too many JavaScript files in the project. Consider specifying the 'exclude' setting in project configuration to limit included source folders. The likely folder to exclude is '{0}'. To disable the project size limit, set the 'disableSizeLimit' compiler option to 'true'." }
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -5455,6 +5459,10 @@ var ts;
return ts.forEach(ts.supportedJavascriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });
}
ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension;
function hasTypeScriptFileExtension(fileName) {
return ts.forEach(ts.supportedTypeScriptExtensions, function (extension) { return ts.fileExtensionIs(fileName, extension); });
}
ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension;
function getExpandedCharCodes(input) {
var output = [];
var length = input.length;
Expand Down Expand Up @@ -32518,6 +32526,7 @@ var ts;
ts.emitTime = 0;
ts.ioReadTime = 0;
ts.ioWriteTime = 0;
ts.maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
var emptyArray = [];
ts.version = "1.8.9";
function findConfigFile(searchPath, fileExists) {
Expand Down Expand Up @@ -32795,6 +32804,8 @@ var ts;
var diagnosticsProducingTypeChecker;
var noDiagnosticsTypeChecker;
var classifiableNames;
var programSizeLimitExceeded = -1;
var programSizeForNonTsFiles = 0;
var skipDefaultLib = options.noLib;
var supportedExtensions = ts.getSupportedExtensions(options);
var start = new Date().getTime();
Expand Down Expand Up @@ -32829,7 +32840,8 @@ var ts;
(oldOptions.target !== options.target) ||
(oldOptions.noLib !== options.noLib) ||
(oldOptions.jsx !== options.jsx) ||
(oldOptions.allowJs !== options.allowJs)) {
(oldOptions.allowJs !== options.allowJs) ||
(oldOptions.disableSizeLimit !== options.disableSizeLimit)) {
oldProgram = undefined;
}
}
Expand Down Expand Up @@ -32865,6 +32877,9 @@ var ts;
verifyCompilerOptions();
ts.programTime += new Date().getTime() - start;
return program;
function exceedProgramSizeLimit() {
return !options.disableSizeLimit && programSizeForNonTsFiles === programSizeLimitExceeded;
}
function getCommonSourceDirectory() {
if (typeof commonSourceDirectory === "undefined") {
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
Expand Down Expand Up @@ -33338,7 +33353,7 @@ var ts;
}
}
}
if (diagnostic) {
if (diagnostic && !exceedProgramSizeLimit()) {
if (refFile !== undefined && refEnd !== undefined && refPos !== undefined) {
fileProcessingDiagnostics.add(ts.createFileDiagnostic.apply(void 0, [refFile, refPos, refEnd - refPos, diagnostic].concat(diagnosticArgument)));
}
Expand All @@ -33363,6 +33378,10 @@ var ts;
}
return file_1;
}
var isNonTsFile = !ts.hasTypeScriptFileExtension(fileName);
if (isNonTsFile && exceedProgramSizeLimit()) {
return undefined;
}
var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {
if (refFile !== undefined && refPos !== undefined && refEnd !== undefined) {
fileProcessingDiagnostics.add(ts.createFileDiagnostic(refFile, refPos, refEnd - refPos, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));
Expand All @@ -33371,6 +33390,19 @@ var ts;
fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));
}
});
if (isNonTsFile && !options.disableSizeLimit && file && file.text) {
programSizeForNonTsFiles += file.text.length;
if (programSizeForNonTsFiles > ts.maxProgramSizeForNonTsFiles) {
var commonSourceDirectory_1 = getCommonSourceDirectory();
var rootLevelDirectory = path.substring(0, Math.max(commonSourceDirectory_1.length, path.indexOf(ts.directorySeparator, commonSourceDirectory_1.length)));
if (rootLevelDirectory[rootLevelDirectory.length - 1] !== ts.directorySeparator) {
rootLevelDirectory += ts.directorySeparator;
}
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Too_many_JavaScript_files_in_the_project_Consider_specifying_the_exclude_setting_in_project_configuration_to_limit_included_source_folders_The_likely_folder_to_exclude_is_0_To_disable_the_project_size_limit_set_the_disableSizeLimit_compiler_option_to_true, rootLevelDirectory));
programSizeForNonTsFiles = programSizeLimitExceeded;
return undefined;
}
}
filesByName.set(path, file);
if (file) {
file.path = path;
Expand Down Expand Up @@ -33916,6 +33948,10 @@ var ts;
name: "noCustomAsyncPromise",
type: "boolean",
experimental: true
},
{
name: "disableSizeLimit",
type: "boolean"
}
];
var optionNameMapCache;
Expand Down Expand Up @@ -34098,7 +34134,7 @@ var ts;
exclude = json["exclude"];
}
else {
exclude = ["node_modules"];
exclude = ["node_modules", "bower_components"];
var outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
if (outDir) {
exclude.push(outDir);
Expand Down
Loading

0 comments on commit 9ef7553

Please sign in to comment.