Skip to content

Commit 960ad11

Browse files
committed
Merge branch 'main' into fix31156
# Conflicts: # src/compiler/checker.ts
2 parents e85971c + 2f26088 commit 960ad11

File tree

317 files changed

+7476
-4745
lines changed

Some content is hidden

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

317 files changed

+7476
-4745
lines changed

CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ The files in `lib/` are used to bootstrap compilation and usually **should not**
148148

149149
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
150150

151+
## Documentation on TypeScript Compiler
152+
153+
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.
154+
151155
## Running the Tests
152156

153157
To run all tests, invoke the `runtests-parallel` target using gulp:

package-lock.json

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compiler/binder.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -3509,21 +3509,22 @@ namespace ts {
35093509

35103510
export function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean {
35113511
let i = 0;
3512-
const q = [node];
3513-
while (q.length && i < 100) {
3512+
const q = createQueue<Expression>();
3513+
q.enqueue(node);
3514+
while (!q.isEmpty() && i < 100) {
35143515
i++;
3515-
node = q.shift()!;
3516+
node = q.dequeue();
35163517
if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) {
35173518
return true;
35183519
}
35193520
else if (isIdentifier(node)) {
35203521
const symbol = lookupSymbolForName(sourceFile, node.escapedText);
35213522
if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {
35223523
const init = symbol.valueDeclaration.initializer;
3523-
q.push(init);
3524+
q.enqueue(init);
35243525
if (isAssignmentExpression(init, /*excludeCompoundAssignment*/ true)) {
3525-
q.push(init.left);
3526-
q.push(init.right);
3526+
q.enqueue(init.left);
3527+
q.enqueue(init.right);
35273528
}
35283529
}
35293530
}

0 commit comments

Comments
 (0)