Rename jsxNamespace to reactNamespace

This commit is contained in:
Mohamed Hegazy
2016-01-07 13:59:25 -08:00
parent c0b28a3a40
commit cc1947b94f
5 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -8360,11 +8360,11 @@ namespace ts {
checkGrammarJsxElement(node);
checkJsxPreconditions(node);
// The symbol 'React' should be marked as 'used' so we don't incorrectly elide its import. And if there
// is no 'React' symbol in scope when targeting React emit, we should issue an error.
// The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there
// is no reactNamespace symbol in scope when targeting React emit, we should issue an error.
const reactRefErr = compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
const jsxNamespace = compilerOptions.jsxNamespace ? compilerOptions.jsxNamespace : "React";
const reactSym = resolveName(node.tagName, jsxNamespace, SymbolFlags.Value, reactRefErr, jsxNamespace);
const reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React";
const reactSym = resolveName(node.tagName, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace);
if (reactSym) {
getSymbolLinks(reactSym).referenced = true;
}
+2 -2
View File
@@ -55,9 +55,9 @@ namespace ts {
error: Diagnostics.Argument_for_jsx_must_be_preserve_or_react
},
{
name: "jsxNamespace",
name: "reactNamespace",
type: "string",
description: Diagnostics.Specify_JSX_emit_namespace_when_JSX_code_generation_mode_is_react
description: Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
},
{
name: "listFiles",
+2 -2
View File
@@ -2393,9 +2393,9 @@
"category": "Message",
"code": 6083
},
"Specify JSX emit namespace when JSX code generation mode is 'react'": {
"Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit": {
"category": "Message",
"code": 6084
"code": 6084
},
"Variable '{0}' implicitly has an '{1}' type.": {
+1 -1
View File
@@ -1186,7 +1186,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
function emitJsxElement(openingNode: JsxOpeningLikeElement, children?: JsxChild[]) {
const syntheticReactRef = <Identifier>createSynthesizedNode(SyntaxKind.Identifier);
syntheticReactRef.text = compilerOptions.jsxNamespace ? compilerOptions.jsxNamespace : "React";
syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React";
syntheticReactRef.parent = openingNode;
// Call React.createElement(tag, ...
+1 -1
View File
@@ -2382,7 +2382,7 @@ namespace ts {
inlineSourceMap?: boolean;
inlineSources?: boolean;
jsx?: JsxEmit;
jsxNamespace? : string;
reactNamespace?: string;
listFiles?: boolean;
locale?: string;
mapRoot?: string;