Parse the jsxFactory again in the checker instead of using cached value in the program

This commit is contained in:
Sheetal Nandi
2016-11-10 08:53:32 -08:00
parent a88c2ae1e4
commit dd7f00f20b
5 changed files with 11 additions and 17 deletions

View File

@@ -329,9 +329,6 @@ namespace ts {
// Map storing if there is emit blocking diagnostics for given input
const hasEmitBlockingDiagnostics = createFileMap<boolean>(getCanonicalFileName);
// ReactNamespace and jsxFactory information
let jsxFactoryEntity: EntityName;
let resolveModuleNamesWorker: (moduleNames: string[], containingFile: string) => ResolvedModuleFull[];
if (host.resolveModuleNames) {
resolveModuleNamesWorker = (moduleNames, containingFile) => host.resolveModuleNames(moduleNames, containingFile).map(resolved => {
@@ -424,8 +421,7 @@ namespace ts {
getFileProcessingDiagnostics: () => fileProcessingDiagnostics,
getResolvedTypeReferenceDirectives: () => resolvedTypeReferenceDirectives,
isSourceFileFromExternalLibrary,
dropDiagnosticsProducingTypeChecker,
getJsxFactoryEntity: () => jsxFactoryEntity
dropDiagnosticsProducingTypeChecker
};
verifyCompilerOptions();
@@ -731,7 +727,6 @@ namespace ts {
writeFile: writeFileCallback || (
(fileName, data, writeByteOrderMark, onError, sourceFiles) => host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles)),
isEmitBlocked,
getJsxFactoryEntity: program.getJsxFactoryEntity,
};
}
@@ -1679,8 +1674,7 @@ namespace ts {
if (options.reactNamespace) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"));
}
jsxFactoryEntity = parseIsolatedEntityName(options.jsxFactory, languageVersion);
if (!jsxFactoryEntity) {
if (!parseIsolatedEntityName(options.jsxFactory, languageVersion)) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory));
}
}