Check the ambientness of a symbol name before attempting to trim it#26312
Merged
weswigham merged 2 commits intomicrosoft:masterfrom Aug 9, 2018
Merged
Check the ambientness of a symbol name before attempting to trim it#26312weswigham merged 2 commits intomicrosoft:masterfrom
weswigham merged 2 commits intomicrosoft:masterfrom
Conversation
RyanCavanaugh
approved these changes
Aug 8, 2018
Member
Author
|
@typescript-bot test this just in case |
Collaborator
|
Heya @weswigham, I've started to run the extended test suite on this PR at 7ff7dcc. You can monitor the build here. It should now contribute to this PR's status checks. |
|
Thank you guys for your good, quick work here! |
ghost
reviewed
Aug 9, 2018
src/compiler/moduleSpecifiers.ts
Outdated
| function tryGetModuleNameFromAmbientModule(moduleSymbol: Symbol): string | undefined { | ||
| const decl = moduleSymbol.valueDeclaration; | ||
| if (isModuleDeclaration(decl) && isStringLiteral(decl.name)) { | ||
| const decl = forEach(moduleSymbol.declarations, d => { |
There was a problem hiding this comment.
Seems like this could use find and boolean operators.
src/compiler/utilities.ts
Outdated
| } | ||
|
|
||
| export function getNonAugmentationDeclaration(symbol: Symbol) { | ||
| return forEach(symbol.declarations, d => isExternalModuleAugmentation(d) ? undefined : d); |
Member
Author
|
@Andy-MS another quick look? |
ghost
approved these changes
Aug 9, 2018
errendir
added a commit
to errendir/TypeScript
that referenced
this pull request
Aug 11, 2018
* origin/master: (283 commits) Don't error on destructure of private property with computed property syntax (microsoft#26360) getDefaultExportInfo: Use `getImmediateAliasedSymbol` instead of `getAliasedSymbol` (microsoft#26364) review comments restore old algorithm Dont use baseURL relative absolute paths in declaration emit, use absolute paths in bundle emit (microsoft#26341) Update user baselines (microsoft#26358) Don't store @template constraint in a TypeParameterDeclaration node (microsoft#26283) fixAddMissingMember: Support interface and don't crash on type parameter (microsoft#25995) Don't include class getter in spread type (microsoft#26287) Don't crash on computed property in destructure (microsoft#26334) Check the ambientness of a symbol name before attempting to trim it (microsoft#26312) Still generate signatures in SkipContextSensitive mode just to match on return types (microsoft#25937) fix handling if there is no commonPrefix Actually add sorting of elaboration text to user baselines Ping ryan instead of mohammed for user PRs now handle failed lookups make it work for root directory really, really fix test(?) add test fix commonPrefix handling ...
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #26295
An export assigned namespace from a declaration file with an augmentation in another file is:
And so naming the module it corresponds to proves to be a more difficult process than we had assumed! If we have a resolver, we can find the file corresponding to the first non-augmentation declaration, however when a resolver is not available we must fall back to the full path of the containing file of that declaration. We actually had a bunch of baselines which exhibited this bug in the
typesbaseline (though none in declaration emit).