From f1e53da978f728262c5c3e37ffee7890022e7cc2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 19 Nov 2020 00:12:36 +0000 Subject: [PATCH] Update LKG --- lib/tsc.js | 30 +++++++++++++++------------- lib/tsserver.js | 42 ++++++++++++++++++++------------------- lib/tsserverlibrary.js | 42 ++++++++++++++++++++------------------- lib/typescript.js | 42 ++++++++++++++++++++------------------- lib/typescriptServices.js | 42 ++++++++++++++++++++------------------- lib/typingsInstaller.js | 42 ++++++++++++++++++++------------------- 6 files changed, 126 insertions(+), 114 deletions(-) diff --git a/lib/tsc.js b/lib/tsc.js index 23c9055413fa7..be83dff6a0b65 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -55286,10 +55286,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920)); @@ -55457,17 +55457,19 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true); - } - if (jsxFactorySym) { - jsxFactorySym.isReferenced = 67108863; - if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true); + } + if (jsxFactorySym) { + jsxFactorySym.isReferenced = 67108863; + if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) { diff --git a/lib/tsserver.js b/lib/tsserver.js index 8cee3c1063e0e..a2b627f45b13f 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -66328,10 +66328,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); @@ -66538,23 +66538,25 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) { diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index b3b6235668eca..48006564d8ed5 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -66522,10 +66522,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); @@ -66732,23 +66732,25 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) { diff --git a/lib/typescript.js b/lib/typescript.js index 19105fcde5d2f..a3c7e072007b7 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -66522,10 +66522,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); @@ -66732,23 +66732,25 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) { diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 0d927b0a26d35..71ac581df9226 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -66522,10 +66522,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); @@ -66732,23 +66732,25 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) { diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index c2fdee805487a..34fd6f239d2f0 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -66317,10 +66317,10 @@ var ts; return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var namespaceName = getJsxNamespace(location); - var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); + var namespaceName = getJsxNamespace(location); + resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); } if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); @@ -66527,23 +66527,25 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym = void 0; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } } } if (isNodeOpeningLikeElement) {