Skip to content

Allow wildcard ("*") patterns in ambient module declarations#8939

Merged
5 commits merged into
masterfrom
pattern_ambient_modules
Jun 9, 2016
Merged

Allow wildcard ("*") patterns in ambient module declarations#8939
5 commits merged into
masterfrom
pattern_ambient_modules

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 2, 2016

Half of #6615

@ghost ghost force-pushed the pattern_ambient_modules branch from 7943883 to ff70666 Compare June 2, 2016 12:43
@ghost ghost force-pushed the pattern_ambient_modules branch from ff70666 to 3b19825 Compare June 2, 2016 12:44
Comment thread src/compiler/types.ts
[index: string]: Symbol;
}

/** Represents a "prefix*suffix" pattern. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* @internal */ as well

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jun 2, 2016

@vladima can you take a look?

Comment thread src/compiler/checker.ts Outdated
mergeSymbolTable(globals, file.locals);
}
if (file.patternAmbientModules && file.patternAmbientModules.length) {
(patternAmbientModules || (patternAmbientModules = [])).push(...file.patternAmbientModules);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i remember we had issues with this pattern for diagnostics, and concat fared better there. consider using patternAmbientModules = concatenate(patternAmbientModules , file.patternAmbientModules) instead.

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jun 8, 2016

Can you add a you add one more test with a relative file name:

declare module "*!text" { .. }

import f from "./file!text";

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jun 8, 2016

other than that 👍

@ghost ghost merged commit 9ffd00d into master Jun 9, 2016
@ghost ghost deleted the pattern_ambient_modules branch June 9, 2016 20:08
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants