Don't forget about spread attributes

This commit is contained in:
Ryan Cavanaugh 2015-07-28 15:31:39 -07:00
parent fc9b10eeb6
commit da39a8be10
5 changed files with 26 additions and 4 deletions

View File

@ -1425,6 +1425,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
case SyntaxKind.IfStatement:
case SyntaxKind.JsxSelfClosingElement:
case SyntaxKind.JsxOpeningElement:
case SyntaxKind.JsxSpreadAttribute:
case SyntaxKind.JsxExpression:
case SyntaxKind.NewExpression:
case SyntaxKind.ParenthesizedExpression:

View File

@ -11,10 +11,15 @@ declare module 'mod' {
import Main from 'mod';
declare var Foo, React;
// Should see mod_1['default'] in emit here
<Foo handler={Main}></Foo>
<Foo handler={Main}></Foo>;
// Should see mod_1['default'] in emit here
<Foo {...Main}></Foo>;
//// [app.js]
var mod_1 = require('mod');
// Should see mod_1['default'] in emit here
React.createElement(Foo, {"handler": mod_1["default"]});
// Should see mod_1['default'] in emit here
React.createElement(Foo, React.__spread({}, mod_1["default"]));

View File

@ -17,7 +17,12 @@ declare var Foo, React;
>React : Symbol(React, Decl(app.tsx, 1, 16))
// Should see mod_1['default'] in emit here
<Foo handler={Main}></Foo>
<Foo handler={Main}></Foo>;
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
>handler : Symbol(unknown)
// Should see mod_1['default'] in emit here
<Foo {...Main}></Foo>;
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))

View File

@ -17,10 +17,18 @@ declare var Foo, React;
>React : any
// Should see mod_1['default'] in emit here
<Foo handler={Main}></Foo>
<Foo handler={Main}></Foo>;
><Foo handler={Main}></Foo> : any
>Foo : any
>handler : any
>Main : any
>Foo : any
// Should see mod_1['default'] in emit here
<Foo {...Main}></Foo>;
><Foo {...Main}></Foo> : any
>Foo : any
>Main : any
>Foo : any

View File

@ -11,4 +11,7 @@ declare module 'mod' {
import Main from 'mod';
declare var Foo, React;
// Should see mod_1['default'] in emit here
<Foo handler={Main}></Foo>
<Foo handler={Main}></Foo>;
// Should see mod_1['default'] in emit here
<Foo {...Main}></Foo>;