-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix renaming an ExportSpecifier name when propertyName is present (#36790) * Fix renaming exportSpecifier name when propertyName is present * Add baseline test for name without propertyName too * Set correct pos for NamespaceExport (#36794) * Set correct pos for NamespaceExport * Update tests * Cherry-pick PR #37064 into release-3.8
- Loading branch information
1 parent
963c1f0
commit d876564
Showing
8 changed files
with
164 additions
and
4 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
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,25 @@ | ||
tests/cases/conformance/externalModules/typeOnly/b.ts(1,1): error TS1383: Only named exports may use 'export type'. | ||
tests/cases/conformance/externalModules/typeOnly/c.ts(1,1): error TS1383: Only named exports may use 'export type'. | ||
|
||
|
||
==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== | ||
export class A {} | ||
|
||
==== tests/cases/conformance/externalModules/typeOnly/b.ts (1 errors) ==== | ||
export type * from './a'; // Grammar error | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS1383: Only named exports may use 'export type'. | ||
|
||
==== tests/cases/conformance/externalModules/typeOnly/c.ts (1 errors) ==== | ||
export type * as ns from './a'; // Grammar error | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS1383: Only named exports may use 'export type'. | ||
|
||
==== tests/cases/conformance/externalModules/typeOnly/d.ts (0 errors) ==== | ||
import { A } from './b'; | ||
A; | ||
|
||
==== tests/cases/conformance/externalModules/typeOnly/e.ts (0 errors) ==== | ||
import { ns } from './c'; | ||
ns.A; | ||
|
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,45 @@ | ||
//// [tests/cases/conformance/externalModules/typeOnly/exportNamespace4.ts] //// | ||
|
||
//// [a.ts] | ||
export class A {} | ||
|
||
//// [b.ts] | ||
export type * from './a'; // Grammar error | ||
|
||
//// [c.ts] | ||
export type * as ns from './a'; // Grammar error | ||
|
||
//// [d.ts] | ||
import { A } from './b'; | ||
A; | ||
|
||
//// [e.ts] | ||
import { ns } from './c'; | ||
ns.A; | ||
|
||
|
||
//// [a.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var A = /** @class */ (function () { | ||
function A() { | ||
} | ||
return A; | ||
}()); | ||
exports.A = A; | ||
//// [b.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
//// [c.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
//// [d.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var b_1 = require("./b"); | ||
b_1.A; | ||
//// [e.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var c_1 = require("./c"); | ||
c_1.ns.A; |
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,27 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.ts === | ||
export class A {} | ||
>A : Symbol(A, Decl(a.ts, 0, 0)) | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/b.ts === | ||
export type * from './a'; // Grammar error | ||
No type information for this code. | ||
No type information for this code.=== tests/cases/conformance/externalModules/typeOnly/c.ts === | ||
export type * as ns from './a'; // Grammar error | ||
>ns : Symbol(ns, Decl(c.ts, 0, 11)) | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/d.ts === | ||
import { A } from './b'; | ||
>A : Symbol(A, Decl(d.ts, 0, 8)) | ||
|
||
A; | ||
>A : Symbol(A, Decl(d.ts, 0, 8)) | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/e.ts === | ||
import { ns } from './c'; | ||
>ns : Symbol(ns, Decl(e.ts, 0, 8)) | ||
|
||
ns.A; | ||
>ns.A : Symbol(ns.A, Decl(a.ts, 0, 0)) | ||
>ns : Symbol(ns, Decl(e.ts, 0, 8)) | ||
>A : Symbol(ns.A, Decl(a.ts, 0, 0)) | ||
|
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,27 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.ts === | ||
export class A {} | ||
>A : A | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/b.ts === | ||
export type * from './a'; // Grammar error | ||
No type information for this code. | ||
No type information for this code.=== tests/cases/conformance/externalModules/typeOnly/c.ts === | ||
export type * as ns from './a'; // Grammar error | ||
>ns : typeof ns | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/d.ts === | ||
import { A } from './b'; | ||
>A : typeof A | ||
|
||
A; | ||
>A : typeof A | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/e.ts === | ||
import { ns } from './c'; | ||
>ns : typeof ns | ||
|
||
ns.A; | ||
>ns.A : typeof ns.A | ||
>ns : typeof ns | ||
>A : typeof ns.A | ||
|
16 changes: 16 additions & 0 deletions
16
tests/cases/conformance/externalModules/typeOnly/exportNamespace4.ts
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,16 @@ | ||
// @Filename: a.ts | ||
export class A {} | ||
|
||
// @Filename: b.ts | ||
export type * from './a'; // Grammar error | ||
|
||
// @Filename: c.ts | ||
export type * as ns from './a'; // Grammar error | ||
|
||
// @Filename: d.ts | ||
import { A } from './b'; | ||
A; | ||
|
||
// @Filename: e.ts | ||
import { ns } from './c'; | ||
ns.A; |