Fix crash when checking module exports for export=

Also make maxNodeModuleJsDepth default to 0 so that incorrect tsconfigs
now let the compiler spend less time compiling JS that is found in
node_modules (especially since most people will already have the d.ts
and want ignore the JS anyway). jsconfig still defaults to 2.
This commit is contained in:
Nathan Shively-Sanders
2016-08-25 09:21:31 -07:00
parent 93de502656
commit c0309fa78e
11 changed files with 123 additions and 7 deletions

View File

@@ -885,7 +885,7 @@ namespace ts {
function convertCompilerOptionsFromJsonWorker(jsonOptions: any,
basePath: string, errors: Diagnostic[], configFileName?: string): CompilerOptions {
const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true } : {};
const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {};
convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, options, Diagnostics.Unknown_compiler_option_0, errors);
return options;
}