-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Do not consider UMD alias symbols as visible within external modules #18049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
weswigham
merged 2 commits into
microsoft:master
from
weswigham:no-umd-globals-in-module-declarations
Sep 7, 2017
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -5,5 +5,5 @@ export var X; | |
>X : any | ||
|
||
export as namespace N | ||
>N : typeof N | ||
>N : typeof "tests/cases/compiler/exportAsNamespace" | ||
|
26 changes: 26 additions & 0 deletions
26
tests/baselines/reference/importShouldNotBeElidedInDeclarationEmit.js
This file contains hidden or 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,26 @@ | ||
//// [tests/cases/compiler/importShouldNotBeElidedInDeclarationEmit.ts] //// | ||
|
||
//// [umd.d.ts] | ||
export as namespace UMD; | ||
|
||
export type Thing = { | ||
a: number; | ||
} | ||
|
||
export declare function makeThing(): Thing; | ||
//// [index.ts] | ||
import { makeThing } from "umd"; | ||
export const thing = makeThing(); | ||
|
||
|
||
//// [index.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var umd_1 = require("umd"); | ||
exports.thing = umd_1.makeThing(); | ||
|
||
|
||
//// [index.d.ts] | ||
export declare const thing: { | ||
a: number; | ||
}; |
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/importShouldNotBeElidedInDeclarationEmit.symbols
This file contains hidden or 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,23 @@ | ||
=== tests/cases/compiler/node_modules/umd.d.ts === | ||
export as namespace UMD; | ||
>UMD : Symbol(UMD, Decl(umd.d.ts, 0, 0)) | ||
|
||
export type Thing = { | ||
>Thing : Symbol(Thing, Decl(umd.d.ts, 0, 24)) | ||
|
||
a: number; | ||
>a : Symbol(a, Decl(umd.d.ts, 2, 21)) | ||
} | ||
|
||
export declare function makeThing(): Thing; | ||
>makeThing : Symbol(makeThing, Decl(umd.d.ts, 4, 1)) | ||
>Thing : Symbol(Thing, Decl(umd.d.ts, 0, 24)) | ||
|
||
=== tests/cases/compiler/index.ts === | ||
import { makeThing } from "umd"; | ||
>makeThing : Symbol(makeThing, Decl(index.ts, 0, 8)) | ||
|
||
export const thing = makeThing(); | ||
>thing : Symbol(thing, Decl(index.ts, 1, 12)) | ||
>makeThing : Symbol(makeThing, Decl(index.ts, 0, 8)) | ||
|
24 changes: 24 additions & 0 deletions
24
tests/baselines/reference/importShouldNotBeElidedInDeclarationEmit.types
This file contains hidden or 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,24 @@ | ||
=== tests/cases/compiler/node_modules/umd.d.ts === | ||
export as namespace UMD; | ||
>UMD : typeof "tests/cases/compiler/node_modules/umd" | ||
|
||
export type Thing = { | ||
>Thing : Thing | ||
|
||
a: number; | ||
>a : number | ||
} | ||
|
||
export declare function makeThing(): Thing; | ||
>makeThing : () => Thing | ||
>Thing : Thing | ||
|
||
=== tests/cases/compiler/index.ts === | ||
import { makeThing } from "umd"; | ||
>makeThing : () => { a: number; } | ||
|
||
export const thing = makeThing(); | ||
>thing : { a: number; } | ||
>makeThing() : { a: number; } | ||
>makeThing : () => { a: number; } | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
tests/cases/compiler/importShouldNotBeElidedInDeclarationEmit.ts
This file contains hidden or 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,12 @@ | ||
// @declaration: true | ||
// @filename: node_modules/umd.d.ts | ||
export as namespace UMD; | ||
|
||
export type Thing = { | ||
a: number; | ||
} | ||
|
||
export declare function makeThing(): Thing; | ||
// @filename: index.ts | ||
import { makeThing } from "umd"; | ||
export const thing = makeThing(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a minimal test that reproduces the error -- looking at this test I would have no idea what it's trying to test..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always strive for the smallest reproducible steps for a failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is now minimal