-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15595 from Microsoft/master-fix15463
[Master] fix 15463
- Loading branch information
Showing
53 changed files
with
1,228 additions
and
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//// [file.tsx] | ||
import React = require('react'); | ||
|
||
interface ButtonProp { | ||
a: number, | ||
b: string, | ||
children: Button; | ||
} | ||
|
||
class Button extends React.Component<ButtonProp, any> { | ||
render() { | ||
let condition: boolean; | ||
if (condition) { | ||
return <InnerButton {...this.props} /> | ||
} | ||
else { | ||
return (<InnerButton {...this.props} > | ||
<div>Hello World</div> | ||
</InnerButton>); | ||
} | ||
} | ||
} | ||
|
||
interface InnerButtonProp { | ||
a: number | ||
} | ||
|
||
class InnerButton extends React.Component<InnerButtonProp, any> { | ||
render() { | ||
return (<button>Hello</button>); | ||
} | ||
} | ||
|
||
|
||
//// [file.jsx] | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
exports.__esModule = true; | ||
var React = require("react"); | ||
var Button = (function (_super) { | ||
__extends(Button, _super); | ||
function Button() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
Button.prototype.render = function () { | ||
var condition; | ||
if (condition) { | ||
return <InnerButton {...this.props}/>; | ||
} | ||
else { | ||
return (<InnerButton {...this.props}> | ||
<div>Hello World</div> | ||
</InnerButton>); | ||
} | ||
}; | ||
return Button; | ||
}(React.Component)); | ||
var InnerButton = (function (_super) { | ||
__extends(InnerButton, _super); | ||
function InnerButton() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
InnerButton.prototype.render = function () { | ||
return (<button>Hello</button>); | ||
}; | ||
return InnerButton; | ||
}(React.Component)); |
80 changes: 80 additions & 0 deletions
80
tests/baselines/reference/checkJsxChildrenProperty12.symbols
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,80 @@ | ||
=== tests/cases/conformance/jsx/file.tsx === | ||
import React = require('react'); | ||
>React : Symbol(React, Decl(file.tsx, 0, 0)) | ||
|
||
interface ButtonProp { | ||
>ButtonProp : Symbol(ButtonProp, Decl(file.tsx, 0, 32)) | ||
|
||
a: number, | ||
>a : Symbol(ButtonProp.a, Decl(file.tsx, 2, 22)) | ||
|
||
b: string, | ||
>b : Symbol(ButtonProp.b, Decl(file.tsx, 3, 14)) | ||
|
||
children: Button; | ||
>children : Symbol(ButtonProp.children, Decl(file.tsx, 4, 14)) | ||
>Button : Symbol(Button, Decl(file.tsx, 6, 1)) | ||
} | ||
|
||
class Button extends React.Component<ButtonProp, any> { | ||
>Button : Symbol(Button, Decl(file.tsx, 6, 1)) | ||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55)) | ||
>React : Symbol(React, Decl(file.tsx, 0, 0)) | ||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55)) | ||
>ButtonProp : Symbol(ButtonProp, Decl(file.tsx, 0, 32)) | ||
|
||
render() { | ||
>render : Symbol(Button.render, Decl(file.tsx, 8, 55)) | ||
|
||
let condition: boolean; | ||
>condition : Symbol(condition, Decl(file.tsx, 10, 5)) | ||
|
||
if (condition) { | ||
>condition : Symbol(condition, Decl(file.tsx, 10, 5)) | ||
|
||
return <InnerButton {...this.props} /> | ||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1)) | ||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37)) | ||
>this : Symbol(Button, Decl(file.tsx, 6, 1)) | ||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37)) | ||
} | ||
else { | ||
return (<InnerButton {...this.props} > | ||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1)) | ||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37)) | ||
>this : Symbol(Button, Decl(file.tsx, 6, 1)) | ||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37)) | ||
|
||
<div>Hello World</div> | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45)) | ||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45)) | ||
|
||
</InnerButton>); | ||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1)) | ||
} | ||
} | ||
} | ||
|
||
interface InnerButtonProp { | ||
>InnerButtonProp : Symbol(InnerButtonProp, Decl(file.tsx, 20, 1)) | ||
|
||
a: number | ||
>a : Symbol(InnerButtonProp.a, Decl(file.tsx, 22, 27)) | ||
} | ||
|
||
class InnerButton extends React.Component<InnerButtonProp, any> { | ||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1)) | ||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55)) | ||
>React : Symbol(React, Decl(file.tsx, 0, 0)) | ||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55)) | ||
>InnerButtonProp : Symbol(InnerButtonProp, Decl(file.tsx, 20, 1)) | ||
|
||
render() { | ||
>render : Symbol(InnerButton.render, Decl(file.tsx, 26, 65)) | ||
|
||
return (<button>Hello</button>); | ||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43)) | ||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43)) | ||
} | ||
} | ||
|
86 changes: 86 additions & 0 deletions
86
tests/baselines/reference/checkJsxChildrenProperty12.types
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,86 @@ | ||
=== tests/cases/conformance/jsx/file.tsx === | ||
import React = require('react'); | ||
>React : typeof React | ||
|
||
interface ButtonProp { | ||
>ButtonProp : ButtonProp | ||
|
||
a: number, | ||
>a : number | ||
|
||
b: string, | ||
>b : string | ||
|
||
children: Button; | ||
>children : Button | ||
>Button : Button | ||
} | ||
|
||
class Button extends React.Component<ButtonProp, any> { | ||
>Button : Button | ||
>React.Component : React.Component<ButtonProp, any> | ||
>React : typeof React | ||
>Component : typeof React.Component | ||
>ButtonProp : ButtonProp | ||
|
||
render() { | ||
>render : () => JSX.Element | ||
|
||
let condition: boolean; | ||
>condition : boolean | ||
|
||
if (condition) { | ||
>condition : boolean | ||
|
||
return <InnerButton {...this.props} /> | ||
><InnerButton {...this.props} /> : JSX.Element | ||
>InnerButton : typeof InnerButton | ||
>this.props : ButtonProp & { children?: React.ReactNode; } | ||
>this : this | ||
>props : ButtonProp & { children?: React.ReactNode; } | ||
} | ||
else { | ||
return (<InnerButton {...this.props} > | ||
>(<InnerButton {...this.props} > <div>Hello World</div> </InnerButton>) : JSX.Element | ||
><InnerButton {...this.props} > <div>Hello World</div> </InnerButton> : JSX.Element | ||
>InnerButton : typeof InnerButton | ||
>this.props : ButtonProp & { children?: React.ReactNode; } | ||
>this : this | ||
>props : ButtonProp & { children?: React.ReactNode; } | ||
|
||
<div>Hello World</div> | ||
><div>Hello World</div> : JSX.Element | ||
>div : any | ||
>div : any | ||
|
||
</InnerButton>); | ||
>InnerButton : typeof InnerButton | ||
} | ||
} | ||
} | ||
|
||
interface InnerButtonProp { | ||
>InnerButtonProp : InnerButtonProp | ||
|
||
a: number | ||
>a : number | ||
} | ||
|
||
class InnerButton extends React.Component<InnerButtonProp, any> { | ||
>InnerButton : InnerButton | ||
>React.Component : React.Component<InnerButtonProp, any> | ||
>React : typeof React | ||
>Component : typeof React.Component | ||
>InnerButtonProp : InnerButtonProp | ||
|
||
render() { | ||
>render : () => JSX.Element | ||
|
||
return (<button>Hello</button>); | ||
>(<button>Hello</button>) : JSX.Element | ||
><button>Hello</button> : JSX.Element | ||
>button : any | ||
>button : any | ||
} | ||
} | ||
|
Oops, something went wrong.