Skip to content

Commit 478b3ee

Browse files
committed
Merge branch 'master' into fix39364
# Conflicts: # src/compiler/checker.ts
2 parents 5523c85 + 6279f98 commit 478b3ee

File tree

264 files changed

+4677
-791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+4677
-791
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ TypeScript is currently accepting contributions in the form of bug fixes. A bug
6363

6464
## Contributing features
6565

66-
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (labelled ["help wanted"](https://github.com/Microsoft/TypeScript/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or in the "Backlog" milestone) by a TypeScript project maintainer) in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
66+
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (labelled ["help wanted"](https://github.com/Microsoft/TypeScript/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) or in the "Backlog" milestone) by a TypeScript project maintainer in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
6767

6868
Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue.
6969

src/compat/deprecations.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,4 +1321,24 @@ namespace ts {
13211321
});
13221322

13231323
// #endregion Renamed node Tests
1324+
1325+
// DEPRECATION: Renamed `Map` and `ReadonlyMap` interfaces
1326+
// DEPRECATION PLAN:
1327+
// - soft: 4.0
1328+
// - remove: TBD (will remove for at least one release before replacing with `ESMap`/`ReadonlyESMap`)
1329+
// - replace: TBD (will eventually replace with `ESMap`/`ReadonlyESMap`)
1330+
// #region Renamed `Map` and `ReadonlyMap` interfaces
1331+
1332+
/**
1333+
* @deprecated Use `ts.ReadonlyESMap<K, V>` instead.
1334+
*/
1335+
export interface ReadonlyMap<T> extends ReadonlyESMap<string, T> {
1336+
}
1337+
1338+
/**
1339+
* @deprecated Use `ts.ESMap<K, V>` instead.
1340+
*/
1341+
export interface Map<T> extends ESMap<string, T> { }
1342+
1343+
// #endregion
13241344
}

src/compiler/binder.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ namespace ts {
218218
let symbolCount = 0;
219219

220220
let Symbol: new (flags: SymbolFlags, name: __String) => Symbol;
221-
let classifiableNames: UnderscoreEscapedMap<true>;
221+
let classifiableNames: Set<__String>;
222222

223223
const unreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };
224224
const reportedUnreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };
@@ -237,7 +237,7 @@ namespace ts {
237237
options = opts;
238238
languageVersion = getEmitScriptTarget(options);
239239
inStrictMode = bindInStrictMode(file, opts);
240-
classifiableNames = createUnderscoreEscapedMap<true>();
240+
classifiableNames = new Set();
241241
symbolCount = 0;
242242

243243
Symbol = objectAllocator.getSymbolConstructor();
@@ -445,7 +445,7 @@ namespace ts {
445445
symbol = symbolTable.get(name);
446446

447447
if (includes & SymbolFlags.Classifiable) {
448-
classifiableNames.set(name, true);
448+
classifiableNames.add(name);
449449
}
450450

451451
if (!symbol) {
@@ -1965,7 +1965,7 @@ namespace ts {
19651965
}
19661966

19671967
if (inStrictMode && !isAssignmentTarget(node)) {
1968-
const seen = createUnderscoreEscapedMap<ElementKind>();
1968+
const seen = new Map<__String, ElementKind>();
19691969

19701970
for (const prop of node.properties) {
19711971
if (prop.kind === SyntaxKind.SpreadAssignment || prop.name.kind !== SyntaxKind.Identifier) {
@@ -2980,6 +2980,9 @@ namespace ts {
29802980
}
29812981

29822982
function bindPotentiallyMissingNamespaces(namespaceSymbol: Symbol | undefined, entityName: BindableStaticNameExpression, isToplevel: boolean, isPrototypeProperty: boolean, containerIsClass: boolean) {
2983+
if (namespaceSymbol?.flags! & SymbolFlags.Alias) {
2984+
return namespaceSymbol;
2985+
}
29832986
if (isToplevel && !isPrototypeProperty) {
29842987
// make symbols or add declarations for intermediate containers
29852988
const flags = SymbolFlags.Module | SymbolFlags.Assignment;
@@ -3143,7 +3146,7 @@ namespace ts {
31433146
bindAnonymousDeclaration(node, SymbolFlags.Class, bindingName);
31443147
// Add name of class expression into the map for semantic classifier
31453148
if (node.name) {
3146-
classifiableNames.set(node.name.escapedText, true);
3149+
classifiableNames.add(node.name.escapedText);
31473150
}
31483151
}
31493152

0 commit comments

Comments
 (0)