Skip to content

Commit b0b66f0

Browse files
committed
pragmas are always added to pragmas map as lowercased
1 parent 975e7b8 commit b0b66f0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23517,7 +23517,7 @@ namespace ts {
2351723517
// if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too
2351823518
const nodeSourceFile = getSourceFileOfNode(node);
2351923519
if (compilerOptions.jsx === JsxEmit.React && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx"))
23520-
&& !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxFrag")) {
23520+
&& !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) {
2352123521
error(node, compilerOptions.jsxFactory
2352223522
? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option
2352323523
: Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments);
@@ -36473,7 +36473,7 @@ namespace ts {
3647336473
if (file.localJsxFragmentFactory) {
3647436474
return file.localJsxFragmentFactory;
3647536475
}
36476-
const jsxFragPragmas = file.pragmas.get("jsxFrag");
36476+
const jsxFragPragmas = file.pragmas.get("jsxfrag");
3647736477
const jsxFragPragma = Array.isArray(jsxFragPragmas) ? jsxFragPragmas[0] : jsxFragPragmas;
3647836478
if (jsxFragPragma) {
3647936479
file.localJsxFragmentFactory = parseIsolatedEntityName(jsxFragPragma.arguments.factory, languageVersion);

src/compiler/parser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8509,7 +8509,9 @@ namespace ts {
85098509
});
85108510
break;
85118511
}
8512-
case "jsx": return; // Accessed directly
8512+
case "jsx":
8513+
case "jsxfrag":
8514+
return; // Accessed directly
85138515
default: Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future?
85148516
}
85158517
});

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6684,7 +6684,7 @@ namespace ts {
66846684
args: [{ name: "factory" }],
66856685
kind: PragmaKindFlags.MultiLine
66866686
},
6687-
"jsxFrag": {
6687+
"jsxfrag": {
66886688
args: [{ name: "factory" }],
66896689
kind: PragmaKindFlags.MultiLine
66906690
},

0 commit comments

Comments
 (0)