mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-12 20:01:02 -05:00
Identify JSX closing tags as identifiers so they emit correctly
Fixes bug #5955
This commit is contained in:
@@ -22,12 +22,28 @@ import ReactRouter = require('react-router');
|
||||
|
||||
import Route = ReactRouter.Route;
|
||||
|
||||
var routes = <Route />;
|
||||
var routes1 = <Route />;
|
||||
|
||||
module M {
|
||||
export var X: any;
|
||||
}
|
||||
module M {
|
||||
// Should emit 'M.X' in both opening and closing tags
|
||||
var y = <X></X>;
|
||||
}
|
||||
|
||||
|
||||
//// [test.jsx]
|
||||
define(["require", "exports", 'react-router'], function (require, exports, ReactRouter) {
|
||||
"use strict";
|
||||
var Route = ReactRouter.Route;
|
||||
var routes = <Route />;
|
||||
var routes1 = <Route />;
|
||||
var M;
|
||||
(function (M) {
|
||||
})(M || (M = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
// Should emit 'M.X' in both opening and closing tags
|
||||
var y = <M.X></M.X>;
|
||||
})(M || (M = {}));
|
||||
});
|
||||
|
||||
@@ -11,10 +11,26 @@ import Route = ReactRouter.Route;
|
||||
>ReactRouter : Symbol(ReactRouter, Decl(react.d.ts, 4, 1))
|
||||
>Route : Symbol(ReactRouter.Route, Decl(react.d.ts, 7, 4))
|
||||
|
||||
var routes = <Route />;
|
||||
>routes : Symbol(routes, Decl(test.tsx, 6, 3))
|
||||
var routes1 = <Route />;
|
||||
>routes1 : Symbol(routes1, Decl(test.tsx, 6, 3))
|
||||
>Route : Symbol(Route, Decl(test.tsx, 2, 45))
|
||||
|
||||
module M {
|
||||
>M : Symbol(M, Decl(test.tsx, 6, 24), Decl(test.tsx, 10, 1))
|
||||
|
||||
export var X: any;
|
||||
>X : Symbol(X, Decl(test.tsx, 9, 11))
|
||||
}
|
||||
module M {
|
||||
>M : Symbol(M, Decl(test.tsx, 6, 24), Decl(test.tsx, 10, 1))
|
||||
|
||||
// Should emit 'M.X' in both opening and closing tags
|
||||
var y = <X></X>;
|
||||
>y : Symbol(y, Decl(test.tsx, 13, 4))
|
||||
>X : Symbol(X, Decl(test.tsx, 9, 11))
|
||||
>X : Symbol(X, Decl(test.tsx, 9, 11))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
|
||||
@@ -11,11 +11,28 @@ import Route = ReactRouter.Route;
|
||||
>ReactRouter : typeof ReactRouter
|
||||
>Route : any
|
||||
|
||||
var routes = <Route />;
|
||||
>routes : any
|
||||
var routes1 = <Route />;
|
||||
>routes1 : any
|
||||
><Route /> : any
|
||||
>Route : any
|
||||
|
||||
module M {
|
||||
>M : typeof M
|
||||
|
||||
export var X: any;
|
||||
>X : any
|
||||
}
|
||||
module M {
|
||||
>M : typeof M
|
||||
|
||||
// Should emit 'M.X' in both opening and closing tags
|
||||
var y = <X></X>;
|
||||
>y : any
|
||||
><X></X> : any
|
||||
>X : any
|
||||
>X : any
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/jsx/react.d.ts ===
|
||||
|
||||
declare module 'react' {
|
||||
|
||||
@@ -23,4 +23,12 @@ import ReactRouter = require('react-router');
|
||||
|
||||
import Route = ReactRouter.Route;
|
||||
|
||||
var routes = <Route />;
|
||||
var routes1 = <Route />;
|
||||
|
||||
module M {
|
||||
export var X: any;
|
||||
}
|
||||
module M {
|
||||
// Should emit 'M.X' in both opening and closing tags
|
||||
var y = <X></X>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user