From cc1947b94f61b0cb87d1535093b95c8b625353a8 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Jan 2016 13:59:25 -0800 Subject: [PATCH] Rename jsxNamespace to reactNamespace --- src/compiler/checker.ts | 8 ++++---- src/compiler/commandLineParser.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- src/compiler/emitter.ts | 2 +- src/compiler/types.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0d6cd8706de..8907323c483 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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; } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 457786fdf80..247a204e9bd 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -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", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e67b6c31fbd..defce6469e1 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -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.": { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 547e4a21140..e6286b06aac 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1186,7 +1186,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitJsxElement(openingNode: JsxOpeningLikeElement, children?: JsxChild[]) { const syntheticReactRef = createSynthesizedNode(SyntaxKind.Identifier); - syntheticReactRef.text = compilerOptions.jsxNamespace ? compilerOptions.jsxNamespace : "React"; + syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React"; syntheticReactRef.parent = openingNode; // Call React.createElement(tag, ... diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 499aefe29a5..edf3a9d63a2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2382,7 +2382,7 @@ namespace ts { inlineSourceMap?: boolean; inlineSources?: boolean; jsx?: JsxEmit; - jsxNamespace? : string; + reactNamespace?: string; listFiles?: boolean; locale?: string; mapRoot?: string;