Skip to content

Commit e341e52

Browse files
committed
Merge branch 'master' into dev/aozgaa/eventPortTelemetry-IOSessionSocket
2 parents ab332cf + 8a7b844 commit e341e52

294 files changed

Lines changed: 5076 additions & 2701 deletions

File tree

Some content is hidden

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

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[submodule "tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter"]
2+
path = tests/cases/user/TypeScript-React-Starter/TypeScript-React-Starter
3+
url = https://github.com/Microsoft/TypeScript-React-Starter
4+
[submodule "tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter"]
5+
path = tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter
6+
url = https://github.com/Microsoft/TypeScript-Node-Starter.git
7+
[submodule "tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter"]
8+
path = tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
9+
url = https://github.com/Microsoft/TypeScript-React-Native-Starter.git
10+
[submodule "tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter"]
11+
path = tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
12+
url = https://github.com/Microsoft/TypeScript-Vue-Starter.git
13+
[submodule "tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter"]
14+
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
15+
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git

Jakefile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,10 @@ compileFile(word2mdJs,
731731
[word2mdTs],
732732
[word2mdTs],
733733
[],
734-
/*useBuiltCompiler*/ false);
734+
/*useBuiltCompiler*/ false,
735+
{
736+
lib: "scripthost,es5"
737+
});
735738

736739
// The generated spec.md; built for the 'generate-spec' task
737740
file(specMd, [word2mdJs, specWord], function () {

src/compiler/binder.ts

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ namespace ts {
15701570
else {
15711571
let pattern: Pattern | undefined;
15721572
if (node.name.kind === SyntaxKind.StringLiteral) {
1573-
const text = (<StringLiteral>node.name).text;
1573+
const { text } = node.name;
15741574
if (hasZeroOrOneAsteriskCharacter(text)) {
15751575
pattern = tryParsePattern(text);
15761576
}
@@ -1589,22 +1589,13 @@ namespace ts {
15891589
else {
15901590
const state = declareModuleSymbol(node);
15911591
if (state !== ModuleInstanceState.NonInstantiated) {
1592-
if (node.symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.RegularEnum)) {
1593-
// if module was already merged with some function, class or non-const enum
1594-
// treat is a non-const-enum-only
1595-
node.symbol.constEnumOnlyModule = false;
1596-
}
1597-
else {
1598-
const currentModuleIsConstEnumOnly = state === ModuleInstanceState.ConstEnumOnly;
1599-
if (node.symbol.constEnumOnlyModule === undefined) {
1600-
// non-merged case - use the current state
1601-
node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly;
1602-
}
1603-
else {
1604-
// merged case: module is const enum only if all its pieces are non-instantiated or const enum
1605-
node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly;
1606-
}
1607-
}
1592+
const { symbol } = node;
1593+
// if module was already merged with some function, class or non-const enum, treat it as non-const-enum-only
1594+
symbol.constEnumOnlyModule = (!(symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.RegularEnum)))
1595+
// Current must be `const enum` only
1596+
&& state === ModuleInstanceState.ConstEnumOnly
1597+
// Can't have been set to 'false' in a previous merged symbol. ('undefined' OK)
1598+
&& symbol.constEnumOnlyModule !== false;
16081599
}
16091600
}
16101601
}
@@ -2205,15 +2196,14 @@ namespace ts {
22052196
bindAnonymousDeclaration(node, SymbolFlags.Alias, getDeclarationName(node));
22062197
}
22072198
else {
2208-
// An export default clause with an expression exports a value
2209-
// We want to exclude both class and function here, this is necessary to issue an error when there are both
2210-
// default export-assignment and default export function and class declaration.
2211-
const flags = node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(<ExportAssignment>node)
2199+
const flags = node.kind === SyntaxKind.ExportAssignment && exportAssignmentIsAlias(node)
22122200
// An export default clause with an EntityNameExpression exports all meanings of that identifier
22132201
? SymbolFlags.Alias
22142202
// An export default clause with any other expression exports a value
22152203
: SymbolFlags.Property;
2216-
declareSymbol(container.symbol.exports, container.symbol, node, flags, SymbolFlags.Property | SymbolFlags.AliasExcludes | SymbolFlags.Class | SymbolFlags.Function);
2204+
// If there is an `export default x;` alias declaration, can't `export default` anything else.
2205+
// (In contrast, you can still have `export default function f() {}` and `export default interface I {}`.)
2206+
declareSymbol(container.symbol.exports, container.symbol, node, flags, SymbolFlags.All);
22172207
}
22182208
}
22192209

src/compiler/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace ts {
7777
}
7878

7979
export interface BuilderOptions {
80-
getCanonicalFileName: (fileName: string) => string;
80+
getCanonicalFileName: GetCanonicalFileName;
8181
computeHash: (data: string) => string;
8282
}
8383

0 commit comments

Comments
 (0)