Skip to content

Commit

Permalink
Fix containing block scope lookup for class member names
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Apr 29, 2024
1 parent fef6927 commit 80da691
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48627,7 +48627,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

function checkContainingBlockScopeBindingUses(node: Node) {
const scope = getEnclosingBlockScopeContainer(node);
const scope = getEnclosingBlockScopeContainer(isDeclarationName(node) ? node.parent : node);
forEachNodeRecursively(scope, checkBlockScopeBindings);
}

Expand Down
18 changes: 0 additions & 18 deletions tests/baselines/reference/privateNameClassExpressionLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,3 @@ for (let i = 0; i < 10; ++i) {
_C_accessor_set = function _C_accessor_set(val) { },
_a));
}


!!!! File privateNameClassExpressionLoop.js differs from original emit in noCheck emit
//// [privateNameClassExpressionLoop.js]
===================================================================
--- Expected The full check baseline
+++ Actual with noCheck set
@@ -1,8 +1,8 @@
-var _a;
+var _C_myField, _C_accessor_get, _C_accessor_set, _a;
const array = [];
for (let i = 0; i < 10; ++i) {
- let _C_instances, _C_myField, _C_method, _C_accessor_get, _C_accessor_set;
+ let _C_instances, _C_method;
array.push((_a = class C {
constructor() {
_C_instances.add(this);
_C_myField.set(this, "hello");

0 comments on commit 80da691

Please sign in to comment.