-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't substitute namespace exported names in JSX intrinsic tag names
- Loading branch information
Showing
7 changed files
with
119 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//// [tests/cases/compiler/namespaceJsxPreserve1.tsx] //// | ||
|
||
//// [namespaceJsxPreserve1.tsx] | ||
/// <reference path="/.lib/react16.d.ts" /> | ||
|
||
export namespace form { | ||
export const input = null; | ||
|
||
export const HiddenInput = () => null; | ||
|
||
export const test1 = <input />; | ||
export const test2 = <HiddenInput />; | ||
} | ||
|
||
|
||
//// [namespaceJsxPreserve1.jsx] | ||
"use strict"; | ||
/// <reference path="react16.d.ts" /> | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.form = void 0; | ||
var form; | ||
(function (form) { | ||
form.input = null; | ||
form.HiddenInput = function () { return null; }; | ||
form.test1 = <input />; | ||
form.test2 = <form.HiddenInput />; | ||
})(form || (exports.form = form = {})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// [tests/cases/compiler/namespaceJsxPreserve1.tsx] //// | ||
|
||
=== namespaceJsxPreserve1.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
|
||
export namespace form { | ||
>form : Symbol(form, Decl(namespaceJsxPreserve1.tsx, 0, 0)) | ||
|
||
export const input = null; | ||
>input : Symbol(input, Decl(namespaceJsxPreserve1.tsx, 3, 14)) | ||
|
||
export const HiddenInput = () => null; | ||
>HiddenInput : Symbol(HiddenInput, Decl(namespaceJsxPreserve1.tsx, 5, 14)) | ||
|
||
export const test1 = <input />; | ||
>test1 : Symbol(test1, Decl(namespaceJsxPreserve1.tsx, 7, 14)) | ||
>input : Symbol(JSX.IntrinsicElements.input, Decl(react16.d.ts, 2570, 106)) | ||
|
||
export const test2 = <HiddenInput />; | ||
>test2 : Symbol(test2, Decl(namespaceJsxPreserve1.tsx, 8, 14)) | ||
>HiddenInput : Symbol(HiddenInput, Decl(namespaceJsxPreserve1.tsx, 5, 14)) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//// [tests/cases/compiler/namespaceJsxPreserve1.tsx] //// | ||
|
||
=== Performance Stats === | ||
Assignability cache: 2,500 | ||
Type Count: 10,000 | ||
Instantiation count: 100,000 | ||
Symbol count: 50,000 | ||
|
||
=== namespaceJsxPreserve1.tsx === | ||
/// <reference path="react16.d.ts" /> | ||
|
||
export namespace form { | ||
>form : typeof form | ||
> : ^^^^^^^^^^^ | ||
|
||
export const input = null; | ||
>input : null | ||
> : ^^^^ | ||
|
||
export const HiddenInput = () => null; | ||
>HiddenInput : () => null | ||
> : ^^^^^^^^^^ | ||
>() => null : () => null | ||
> : ^^^^^^^^^^ | ||
|
||
export const test1 = <input />; | ||
>test1 : JSX.Element | ||
> : ^^^^^^^^^^^ | ||
><input /> : JSX.Element | ||
> : ^^^^^^^^^^^ | ||
>input : null | ||
> : ^^^^ | ||
|
||
export const test2 = <HiddenInput />; | ||
>test2 : JSX.Element | ||
> : ^^^^^^^^^^^ | ||
><HiddenInput /> : JSX.Element | ||
> : ^^^^^^^^^^^ | ||
>HiddenInput : () => null | ||
> : ^^^^^^^^^^ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @strict: true | ||
// @jsx: preserve | ||
|
||
/// <reference path="/.lib/react16.d.ts" /> | ||
|
||
export namespace form { | ||
export const input = null; | ||
|
||
export const HiddenInput = () => null; | ||
|
||
export const test1 = <input />; | ||
export const test2 = <HiddenInput />; | ||
} |