Skip to content

Commit

Permalink
Rename to resolveJsxNamespaceAtLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Hanson committed May 25, 2017
1 parent dbb4d46 commit 98bcf5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ namespace ts {
getSuggestionForNonexistentProperty,
getSuggestionForNonexistentSymbol,
getBaseConstraintOfType,
getJsxNamespaceSymbol: node => {
resolveJsxNamespaceAtLocation: node => {
node = getParseTreeNode(node);
return getJsxNamespaceSymbol(node, /*diagnostics*/ false);
return resolveJsxNamespaceAtLocation(node, /*diagnostics*/ false);
},
};

Expand Down Expand Up @@ -14106,7 +14106,7 @@ namespace ts {
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.
const reactSym = getJsxNamespaceSymbol(node.tagName, /*diagnostics*/ true);
const reactSym = resolveJsxNamespaceAtLocation(node.tagName, /*diagnostics*/ true);
if (reactSym) {
// Mark local symbol as referenced here because it might not have been marked
// if jsx emit was not react as there wont be error being emitted
Expand All @@ -14121,7 +14121,7 @@ namespace ts {
checkJsxAttributesAssignableToTagNameAttributes(node);
}

function getJsxNamespaceSymbol(location: ts.Node, diagnostics: boolean): Symbol {
function resolveJsxNamespaceAtLocation(location: ts.Node, diagnostics: boolean): Symbol {
const reactRefErr = diagnostics && compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
const reactNamespace = getJsxNamespace();
return resolveName(location, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace);
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2595,7 +2595,7 @@ namespace ts {
*/
/* @internal */ getAllPossiblePropertiesOfType(type: Type): Symbol[];

/* @internal */ getJsxNamespaceSymbol(location: ts.Node): Symbol;
/* @internal */ resolveJsxNamespaceAtLocation(location: ts.Node): Symbol;
}

export enum NodeBuilderFlags {
Expand Down

0 comments on commit 98bcf5a

Please sign in to comment.