Skip to content

Commit 272e555

Browse files
committed
Merge branch 'master' into gulpProjectRefs
2 parents 2fc014a + 22fde18 commit 272e555

88 files changed

Lines changed: 1052 additions & 419 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.

.mailmap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ Michael <maykelchiche@gmail.com>
139139
Mike Busyrev <busyrev@gmail.com>
140140
Mine Starks <minestarks@users.noreply.github.com> Mine Starks <mineyalc@microsoft.com>
141141
Mohamed Hegazy <mhegazy@microsoft.com>
142-
ncoley <nrcoley@gmail.com> # Natalie Coley
143142
Nathan Shively-Sanders <nathansa@microsoft.com> Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
144143
Nathan Yee <ny.nathan.yee@gmail.com>
145144
Nima Zahedi <nima.zahedee@gmail.com>

Gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const generatedLCGFile = "built/local/enu/diagnosticMessages.generated.json.lcg"
128128
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
129129
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
130130
*/
131-
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]
131+
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"]
132132
.map(f => `built/local/${f}/diagnosticMessages.generated.json`)
133133
.concat(generatedLCGFile);
134134

Jakefile.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else if (process.env.PATH !== undefined) {
2121

2222
const host = process.env.TYPESCRIPT_HOST || process.env.host || "node";
2323

24-
const locales = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"];
24+
const locales = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"];
2525

2626
const defaultTestTimeout = 40000;
2727

@@ -69,10 +69,10 @@ Paths.tsserverLibraryDefinitionFile = "built/local/tsserverlibrary.d.ts";
6969
Paths.baselines = {};
7070
Paths.baselines.local = "tests/baselines/local";
7171
Paths.baselines.localTest262 = "tests/baselines/test262/local";
72-
Paths.baselines.localRwc = "tests/baselines/rwc/local";
72+
Paths.baselines.localRwc = "internal/baselines/rwc/local";
7373
Paths.baselines.reference = "tests/baselines/reference";
7474
Paths.baselines.referenceTest262 = "tests/baselines/test262/reference";
75-
Paths.baselines.referenceRwc = "tests/baselines/rwc/reference";
75+
Paths.baselines.referenceRwc = "internal/baselines/rwc/reference";
7676
Paths.copyright = "CopyrightNotice.txt";
7777
Paths.thirdParty = "ThirdPartyNoticeText.txt";
7878
Paths.processDiagnosticMessagesJs = "scripts/processDiagnosticMessages.js";
@@ -174,7 +174,7 @@ task(TaskNames.lkg, [
174174
if (sizeAfter > (sizeBefore * 1.10)) {
175175
throw new Error("The lib folder increased by 10% or more. This likely indicates a bug.");
176176
}
177-
177+
178178
complete();
179179
});
180180
}, { async: true });
@@ -349,7 +349,7 @@ file(Paths.servicesDefinitionFile, [TaskNames.coreBuild], function() {
349349
},
350350
files
351351
};
352-
352+
353353
const configFilePath = `built/local/typescriptServices.tsconfig.json`;
354354
fs.writeFileSync(configFilePath, JSON.stringify(config, undefined, 2));
355355
tsbuild(configFilePath, false, () => {
@@ -696,8 +696,8 @@ function diagnosticsToString(diagnostics, pretty) {
696696

697697
/**
698698
* Concatenate a list of sourceFiles to a destinationFile
699-
* @param {string} destinationFile
700-
* @param {string[]} sourceFiles
699+
* @param {string} destinationFile
700+
* @param {string[]} sourceFiles
701701
* @param {string} extraContent
702702
*/
703703
function concatenateFiles(destinationFile, sourceFiles, extraContent) {
@@ -724,8 +724,8 @@ function appendToFile(path, content) {
724724
}
725725

726726
/**
727-
*
728-
* @param {string} path
727+
*
728+
* @param {string} path
729729
* @returns string
730730
*/
731731
function readFileSync(path) {
@@ -742,7 +742,7 @@ function getDiffTool() {
742742

743743
/**
744744
* Replaces const enum declarations with non-const enums
745-
* @param {string} text
745+
* @param {string} text
746746
*/
747747
function removeConstModifierFromEnumDeclarations(text) {
748748
return text.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, '$1$2enum $3 {$4');

scripts/generateLocalizedDiagnosticMessages.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ function main(): void {
6565
* There are three exceptions, zh-CN, zh-TW and pt-BR.
6666
*/
6767
function getPreferedLocaleName(localeName: string) {
68-
localeName = localeName.toLowerCase();
6968
switch (localeName) {
70-
case "zh-cn":
71-
case "zh-tw":
72-
case "pt-br":
69+
case "zh-CN":
70+
case "zh-TW":
71+
case "pt-BR":
7372
return localeName;
7473
default:
7574
return localeName.split("-")[0];

src/compiler/checker.ts

Lines changed: 108 additions & 107 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace ts {
4444
["esnext.array", "lib.esnext.array.d.ts"],
4545
["esnext.symbol", "lib.esnext.symbol.d.ts"],
4646
["esnext.asynciterable", "lib.esnext.asynciterable.d.ts"],
47+
["esnext.intl", "lib.esnext.intl.d.ts"]
4748
];
4849

4950
/**

src/compiler/diagnosticMessages.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3636,7 +3636,7 @@
36363636
"category": "Message",
36373637
"code": 6353
36383638
},
3639-
3639+
36403640
"Project '{0}' is up to date with .d.ts files from its dependencies": {
36413641
"category": "Message",
36423642
"code": 6354
@@ -3836,6 +3836,10 @@
38363836
"category": "Error",
38373837
"code": 7039
38383838
},
3839+
"If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{0}`": {
3840+
"category": "Error",
3841+
"code": 7040
3842+
},
38393843
"You cannot rename this element.": {
38403844
"category": "Error",
38413845
"code": 8000

src/compiler/emitter.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ namespace ts {
192192
// Setup and perform the transformation to retrieve declarations from the input files
193193
const nonJsFiles = filter(sourceFiles, isSourceFileNotJavaScript);
194194
const inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [createBundle(nonJsFiles, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : nonJsFiles;
195+
if (emitOnlyDtsFiles && !compilerOptions.declaration) {
196+
// Checker wont collect the linked aliases since thats only done when declaration is enabled.
197+
// Do that here when emitting only dts files
198+
nonJsFiles.forEach(collectLinkedAliases);
199+
}
195200
const declarationTransform = transformNodes(resolver, host, compilerOptions, inputListOrBundle, concatenate([transformDeclarations], declarationTransformers), /*allowDtsFiles*/ false);
196201
if (length(declarationTransform.diagnostics)) {
197202
for (const diagnostic of declarationTransform.diagnostics!) {
@@ -221,6 +226,20 @@ namespace ts {
221226
declarationTransform.dispose();
222227
}
223228

229+
function collectLinkedAliases(node: Node) {
230+
if (isExportAssignment(node)) {
231+
if (node.expression.kind === SyntaxKind.Identifier) {
232+
resolver.collectLinkedAliases(node.expression as Identifier, /*setVisibility*/ true);
233+
}
234+
return;
235+
}
236+
else if (isExportSpecifier(node)) {
237+
resolver.collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true);
238+
return;
239+
}
240+
forEachChild(node, collectLinkedAliases);
241+
}
242+
224243
function printSourceFileOrBundle(jsFilePath: string, sourceMapFilePath: string | undefined, sourceFileOrBundle: SourceFile | Bundle, bundleInfoPath: string | undefined, printer: Printer, mapRecorder: SourceMapWriter) {
225244
const bundle = sourceFileOrBundle.kind === SyntaxKind.Bundle ? sourceFileOrBundle : undefined;
226245
const sourceFile = sourceFileOrBundle.kind === SyntaxKind.SourceFile ? sourceFileOrBundle : undefined;

src/compiler/factory.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ namespace ts {
194194
}
195195

196196
/** Create a unique name generated for a node. */
197-
export function getGeneratedNameForNode(node: Node): Identifier;
198-
/* @internal */ export function getGeneratedNameForNode(node: Node, flags: GeneratedIdentifierFlags): Identifier; // tslint:disable-line unified-signatures
199-
export function getGeneratedNameForNode(node: Node, flags?: GeneratedIdentifierFlags): Identifier {
200-
const name = createIdentifier(isIdentifier(node) ? idText(node) : "");
197+
export function getGeneratedNameForNode(node: Node | undefined): Identifier;
198+
/* @internal */ export function getGeneratedNameForNode(node: Node | undefined, flags: GeneratedIdentifierFlags): Identifier; // tslint:disable-line unified-signatures
199+
export function getGeneratedNameForNode(node: Node | undefined, flags?: GeneratedIdentifierFlags): Identifier {
200+
const name = createIdentifier(node && isIdentifier(node) ? idText(node) : "");
201201
name.autoGenerateFlags = GeneratedIdentifierFlags.Node | flags!;
202202
name.autoGenerateId = nextAutoGenerateId;
203203
name.original = node;

src/compiler/transformers/declarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ namespace ts {
10221022
}
10231023
const members = createNodeArray(concatenate(parameterProperties, visitNodes(input.members, visitDeclarationSubtree)));
10241024

1025-
const extendsClause = getClassExtendsHeritageClauseElement(input);
1025+
const extendsClause = getEffectiveBaseTypeNode(input);
10261026
if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== SyntaxKind.NullKeyword) {
10271027
// We must add a temporary declaration for the extends clause expression
10281028

0 commit comments

Comments
 (0)