CR feedback

This commit is contained in:
Ryan Cavanaugh
2015-08-26 15:28:21 -07:00
parent 4aec447dba
commit 6b476b2b5f
4 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//// [tests/cases/conformance/jsx/tsxReactEmit5.tsx] ////
//// [file.tsx]
declare module JSX {
interface Element { }
interface IntrinsicElements {
[s: string]: any;
}
}
//// [test.d.ts]
export var React;
//// [react-consumer.tsx]
import {React} from "./test";
// Should emit test_1.React.createElement
// and React.__spread
var foo;
var spread1 = <div x='' {...foo} y='' />;
//// [file.js]
//// [react-consumer.js]
var test_1 = require("./test");
// Should emit test_1.React.createElement
// and React.__spread
var foo;
var spread1 = test_1.React.createElement("div", test_1.React.__spread({x: ''}, foo, {y: ''}));

View File

@@ -0,0 +1,35 @@
=== tests/cases/conformance/jsx/file.tsx ===
declare module JSX {
>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
interface Element { }
>Element : Symbol(Element, Decl(file.tsx, 1, 20))
interface IntrinsicElements {
>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22))
[s: string]: any;
>s : Symbol(s, Decl(file.tsx, 4, 3))
}
}
=== tests/cases/conformance/jsx/test.d.ts ===
export var React;
>React : Symbol(React, Decl(test.d.ts, 0, 10))
=== tests/cases/conformance/jsx/react-consumer.tsx ===
import {React} from "./test";
>React : Symbol(React, Decl(react-consumer.tsx, 0, 8))
// Should emit test_1.React.createElement
// and React.__spread
var foo;
>foo : Symbol(foo, Decl(react-consumer.tsx, 3, 3))
var spread1 = <div x='' {...foo} y='' />;
>spread1 : Symbol(spread1, Decl(react-consumer.tsx, 4, 3))
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
>x : Symbol(unknown)
>y : Symbol(unknown)

View File

@@ -0,0 +1,37 @@
=== tests/cases/conformance/jsx/file.tsx ===
declare module JSX {
>JSX : any
interface Element { }
>Element : Element
interface IntrinsicElements {
>IntrinsicElements : IntrinsicElements
[s: string]: any;
>s : string
}
}
=== tests/cases/conformance/jsx/test.d.ts ===
export var React;
>React : any
=== tests/cases/conformance/jsx/react-consumer.tsx ===
import {React} from "./test";
>React : any
// Should emit test_1.React.createElement
// and React.__spread
var foo;
>foo : any
var spread1 = <div x='' {...foo} y='' />;
>spread1 : JSX.Element
><div x='' {...foo} y='' /> : JSX.Element
>div : any
>x : any
>foo : any
>y : any

View File

@@ -0,0 +1,20 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
declare module JSX {
interface Element { }
interface IntrinsicElements {
[s: string]: any;
}
}
//@filename: test.d.ts
export var React;
//@filename: react-consumer.tsx
import {React} from "./test";
// Should emit test_1.React.createElement
// and React.__spread
var foo;
var spread1 = <div x='' {...foo} y='' />;