Skip to content

Commit da39a8b

Browse files
committed
Don't forget about spread attributes
1 parent fc9b10e commit da39a8b

5 files changed

Lines changed: 26 additions & 4 deletions

File tree

src/compiler/emitter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
14251425
case SyntaxKind.IfStatement:
14261426
case SyntaxKind.JsxSelfClosingElement:
14271427
case SyntaxKind.JsxOpeningElement:
1428+
case SyntaxKind.JsxSpreadAttribute:
14281429
case SyntaxKind.JsxExpression:
14291430
case SyntaxKind.NewExpression:
14301431
case SyntaxKind.ParenthesizedExpression:

tests/baselines/reference/tsxExternalModuleEmit2.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ declare module 'mod' {
1111
import Main from 'mod';
1212
declare var Foo, React;
1313
// Should see mod_1['default'] in emit here
14-
<Foo handler={Main}></Foo>
14+
<Foo handler={Main}></Foo>;
15+
// Should see mod_1['default'] in emit here
16+
<Foo {...Main}></Foo>;
17+
1518

1619

1720
//// [app.js]
1821
var mod_1 = require('mod');
1922
// Should see mod_1['default'] in emit here
2023
React.createElement(Foo, {"handler": mod_1["default"]});
24+
// Should see mod_1['default'] in emit here
25+
React.createElement(Foo, React.__spread({}, mod_1["default"]));

tests/baselines/reference/tsxExternalModuleEmit2.symbols

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ declare var Foo, React;
1717
>React : Symbol(React, Decl(app.tsx, 1, 16))
1818

1919
// Should see mod_1['default'] in emit here
20-
<Foo handler={Main}></Foo>
20+
<Foo handler={Main}></Foo>;
2121
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
2222
>handler : Symbol(unknown)
2323

24+
// Should see mod_1['default'] in emit here
25+
<Foo {...Main}></Foo>;
26+
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
27+
28+

tests/baselines/reference/tsxExternalModuleEmit2.types

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ declare var Foo, React;
1717
>React : any
1818

1919
// Should see mod_1['default'] in emit here
20-
<Foo handler={Main}></Foo>
20+
<Foo handler={Main}></Foo>;
2121
><Foo handler={Main}></Foo> : any
2222
>Foo : any
2323
>handler : any
2424
>Main : any
2525
>Foo : any
2626

27+
// Should see mod_1['default'] in emit here
28+
<Foo {...Main}></Foo>;
29+
><Foo {...Main}></Foo> : any
30+
>Foo : any
31+
>Main : any
32+
>Foo : any
33+
34+

tests/cases/conformance/jsx/tsxExternalModuleEmit2.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ declare module 'mod' {
1111
import Main from 'mod';
1212
declare var Foo, React;
1313
// Should see mod_1['default'] in emit here
14-
<Foo handler={Main}></Foo>
14+
<Foo handler={Main}></Foo>;
15+
// Should see mod_1['default'] in emit here
16+
<Foo {...Main}></Foo>;
17+

0 commit comments

Comments
 (0)