Skip to content

Commit 7e1e976

Browse files
committed
Use getResolvedSymbol to pass into checkIdentifierCalculateNodeCheckFlags like other call
1 parent 033a906 commit 7e1e976

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49377,7 +49377,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4937749377
const nodeLinks = getNodeLinks(node);
4937849378
nodeLinks.calculatedFlags |= NodeCheckFlags.ConstructorReference | NodeCheckFlags.CapturedBlockScopedBinding | NodeCheckFlags.BlockScopedBindingInLoop;
4937949379
if (isIdentifier(node) && isExpressionNode(node) && !(isPropertyAccessExpression(node.parent) && node.parent.name === node)) {
49380-
const s = getSymbolAtLocation(node, /*ignoreErrors*/ true);
49380+
const s = getResolvedSymbol(node);
4938149381
if (s && s !== unknownSymbol) {
4938249382
checkIdentifierCalculateNodeCheckFlags(node, s);
4938349383
}

tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,3 @@ for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
2020
}
2121
var result = fns.map(function (fn) { return fn(); });
2222
console.log(result);
23-
24-
25-
!!!! File capturedShorthandPropertyAssignmentNoCheck.js differs from original emit in noCheck emit
26-
//// [capturedShorthandPropertyAssignmentNoCheck.js]
27-
===================================================================
28-
--- Expected The full check baseline
29-
+++ Actual with noCheck set
30-
@@ -1,10 +1,7 @@
31-
var fns = [];
32-
-var _loop_1 = function (value) {
33-
- fns.push(function () { return ({ value: value }); });
34-
-};
35-
for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
36-
var value = _a[_i];
37-
- _loop_1(value);
38-
+ fns.push(function () { return ({ value: value }); });
39-
}
40-
var result = fns.map(function (fn) { return fn(); });
41-
console.log(result);

0 commit comments

Comments
 (0)