Skip to content

Commit

Permalink
Merge branch 'main' into fix31156
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/compiler/checker.ts
  • Loading branch information
ahejlsberg committed Jul 5, 2022
2 parents e85971c + 2f26088 commit 960ad11
Show file tree
Hide file tree
Showing 317 changed files with 7,476 additions and 4,745 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ The files in `lib/` are used to bootstrap compilation and usually **should not**

The files `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` both represent type declarations for the DOM and are auto-generated. To make any modifications to them, you will have to direct changes to https://github.com/Microsoft/TSJS-lib-generator

## Documentation on TypeScript Compiler

If you need a head start understanding how the compiler works, or how the code in different parts of the compiler works, there is a separate repo: [TypeScript Compiler Notes](https://github.com/microsoft/TypeScript-Compiler-Notes). As the name implies, it contains notes understood by different engineers about different parts of the compiler.

## Running the Tests

To run all tests, invoke the `runtests-parallel` target using gulp:
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3509,21 +3509,22 @@ namespace ts {

export function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean {
let i = 0;
const q = [node];
while (q.length && i < 100) {
const q = createQueue<Expression>();
q.enqueue(node);
while (!q.isEmpty() && i < 100) {
i++;
node = q.shift()!;
node = q.dequeue();
if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) {
return true;
}
else if (isIdentifier(node)) {
const symbol = lookupSymbolForName(sourceFile, node.escapedText);
if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {
const init = symbol.valueDeclaration.initializer;
q.push(init);
q.enqueue(init);
if (isAssignmentExpression(init, /*excludeCompoundAssignment*/ true)) {
q.push(init.left);
q.push(init.right);
q.enqueue(init.left);
q.enqueue(init.right);
}
}
}
Expand Down
Loading

0 comments on commit 960ad11

Please sign in to comment.