Skip to content

Commit 10ee6d9

Browse files
authored
Merge branch 'master' into add-codefix-cannot-find-name-in-for-loop
2 parents e0a685d + 7dc1f40 commit 10ee6d9

File tree

441 files changed

+37191
-1616
lines changed

Some content is hidden

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

441 files changed

+37191
-1616
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
2+
# TypeScript
3+
4+
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
15
[![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
26
[![VSTS Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build/latest?definitionId=4&view=logs)
37
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
48
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
59

6-
# TypeScript
710

8-
[![Join the chat at https://gitter.im/Microsoft/TypeScript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
911

1012
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
1113

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "https://www.typescriptlang.org/",
5-
"version": "3.5.0",
5+
"version": "3.6.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

scripts/open-user-pr.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function padNum(number: number) {
99
}
1010

1111
const userName = process.env.GH_USERNAME;
12-
const reviewers = process.env.requesting_user ? [process.env.requesting_user] : ["weswigham", "sandersn", "RyanCavanaugh"];
12+
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
1313
const now = new Date();
1414
const branchName = `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
1515
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
@@ -36,14 +36,14 @@ gh.pulls.create({
3636
head: `${userName}:${branchName}`,
3737
base: process.env.TARGET_BRANCH || "master",
3838
body:
39-
`${process.env.source_issue ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.source_issue} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
39+
`${process.env.SOURCE_ISSUE ? `This test run was triggerd by a request on https://github.com/Microsoft/TypeScript/pull/${process.env.SOURCE_ISSUE} `+"\n" : ""}Please review the diff and merge if no changes are unexpected.
4040
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).
4141
4242
cc ${reviewers.map(r => "@" + r).join(" ")}`,
4343
}).then(async r => {
4444
const num = r.data.number;
4545
console.log(`Pull request ${num} created.`);
46-
if (!process.env.source_issue) {
46+
if (!process.env.SOURCE_ISSUE) {
4747
await gh.pulls.createReviewRequest({
4848
owner: process.env.TARGET_FORK,
4949
repo: "TypeScript",
@@ -53,7 +53,7 @@ cc ${reviewers.map(r => "@" + r).join(" ")}`,
5353
}
5454
else {
5555
await gh.issues.createComment({
56-
number: +process.env.source_issue,
56+
number: +process.env.SOURCE_ISSUE,
5757
owner: "Microsoft",
5858
repo: "TypeScript",
5959
body: `The user suite test run you requested has finished and _failed_. I've opened a [PR with the baseline diff from master](${r.data.html_url}).`

src/compiler/binder.ts

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ namespace ts {
25152515
break;
25162516

25172517
default:
2518-
Debug.fail(Debug.showSyntaxKind(thisContainer));
2518+
Debug.failBadSyntaxKind(thisContainer);
25192519
}
25202520
}
25212521

@@ -2581,7 +2581,7 @@ namespace ts {
25812581
// Fix up parent pointers since we're going to use these nodes before we bind into them
25822582
node.left.parent = node;
25832583
node.right.parent = node;
2584-
if (isIdentifier(lhs.expression) && container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, lhs.expression)) {
2584+
if (isIdentifier(lhs.expression) && container === file && isExportsOrModuleExportsOrAlias(file, lhs.expression)) {
25852585
// This can be an alias for the 'exports' or 'module.exports' names, e.g.
25862586
// var util = module.exports;
25872587
// util.property = function ...
@@ -2975,21 +2975,27 @@ namespace ts {
29752975
}
29762976

29772977
export function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean {
2978-
return isExportsIdentifier(node) ||
2979-
isModuleExportsPropertyAccessExpression(node) ||
2980-
isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node);
2981-
}
2982-
2983-
function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile: SourceFile, node: Identifier): boolean {
2984-
const symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText);
2985-
return !!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) &&
2986-
!!symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer);
2987-
}
2988-
2989-
function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile: SourceFile, node: Expression): boolean {
2990-
return isExportsOrModuleExportsOrAlias(sourceFile, node) ||
2991-
(isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && (
2992-
isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right)));
2978+
let i = 0;
2979+
const q = [node];
2980+
while (q.length && i < 100) {
2981+
i++;
2982+
node = q.shift()!;
2983+
if (isExportsIdentifier(node) || isModuleExportsPropertyAccessExpression(node)) {
2984+
return true;
2985+
}
2986+
else if (isIdentifier(node)) {
2987+
const symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText);
2988+
if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {
2989+
const init = symbol.valueDeclaration.initializer;
2990+
q.push(init);
2991+
if (isAssignmentExpression(init, /*excludeCompoundAssignment*/ true)) {
2992+
q.push(init.left);
2993+
q.push(init.right);
2994+
}
2995+
}
2996+
}
2997+
}
2998+
return false;
29932999
}
29943000

29953001
function lookupSymbolForNameWorker(container: Node, name: __String): Symbol | undefined {

0 commit comments

Comments
 (0)