Skip to content

Commit 80da691

Browse files
committed
Fix containing block scope lookup for class member names
1 parent fef6927 commit 80da691

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48627,7 +48627,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4862748627
}
4862848628

4862948629
function checkContainingBlockScopeBindingUses(node: Node) {
48630-
const scope = getEnclosingBlockScopeContainer(node);
48630+
const scope = getEnclosingBlockScopeContainer(isDeclarationName(node) ? node.parent : node);
4863148631
forEachNodeRecursively(scope, checkBlockScopeBindings);
4863248632
}
4863348633

tests/baselines/reference/privateNameClassExpressionLoop.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,3 @@ for (let i = 0; i < 10; ++i) {
3030
_C_accessor_set = function _C_accessor_set(val) { },
3131
_a));
3232
}
33-
34-
35-
!!!! File privateNameClassExpressionLoop.js differs from original emit in noCheck emit
36-
//// [privateNameClassExpressionLoop.js]
37-
===================================================================
38-
--- Expected The full check baseline
39-
+++ Actual with noCheck set
40-
@@ -1,8 +1,8 @@
41-
-var _a;
42-
+var _C_myField, _C_accessor_get, _C_accessor_set, _a;
43-
const array = [];
44-
for (let i = 0; i < 10; ++i) {
45-
- let _C_instances, _C_myField, _C_method, _C_accessor_get, _C_accessor_set;
46-
+ let _C_instances, _C_method;
47-
array.push((_a = class C {
48-
constructor() {
49-
_C_instances.add(this);
50-
_C_myField.set(this, "hello");

0 commit comments

Comments
 (0)