Skip to content

Commit afe1c32

Browse files
authored
Revert "🤖 Pick PR #59285 (Fix captured shorthand properties i...) into release-5.5 (#59288)" (#59305)
1 parent cf167db commit afe1c32

20 files changed

+30
-157
lines changed

‎src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49242,7 +49242,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4924249242
const nodeLinks = getNodeLinks(node);
4924349243
nodeLinks.calculatedFlags |= NodeCheckFlags.ConstructorReference | NodeCheckFlags.CapturedBlockScopedBinding | NodeCheckFlags.BlockScopedBindingInLoop;
4924449244
if (isIdentifier(node) && isExpressionNode(node) && !(isPropertyAccessExpression(node.parent) && node.parent.name === node)) {
49245-
const s = getResolvedSymbol(node);
49245+
const s = getSymbolAtLocation(node, /*ignoreErrors*/ true);
4924649246
if (s && s !== unknownSymbol) {
4924749247
checkIdentifierCalculateNodeCheckFlags(node, s);
4924849248
}

‎src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3493,7 +3493,7 @@ export function isInExpressionContext(node: Node): boolean {
34933493
case SyntaxKind.ExpressionWithTypeArguments:
34943494
return (parent as ExpressionWithTypeArguments).expression === node && !isPartOfTypeNode(parent);
34953495
case SyntaxKind.ShorthandPropertyAssignment:
3496-
return ((parent as ShorthandPropertyAssignment).objectAssignmentInitializer ?? (parent as ShorthandPropertyAssignment).name) === node;
3496+
return (parent as ShorthandPropertyAssignment).objectAssignmentInitializer === node;
34973497
case SyntaxKind.SatisfiesExpression:
34983498
return node === (parent as SatisfiesExpression).expression;
34993499
default:

‎tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck.symbols

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck.types

Lines changed: 0 additions & 68 deletions
This file was deleted.

‎tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const obj = {
6161

6262
/** @type {string} */
6363
lol
64-
>lol : undefined
65-
> : ^^^^^^^^^
64+
>lol : string
65+
> : ^^^^^^
6666
}
6767
lol = "string"
6868
>lol = "string" : "string"

‎tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export function makeNewChannel<T extends ChannelType>(type: T): NewChannel<Chann
8686
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787
>type : T
8888
> : ^
89-
>localChannelId : "blahblahblah"
90-
> : ^^^^^^^^^^^^^^
89+
>localChannelId : string
90+
> : ^^^^^^
9191
}
9292

9393
const newTextChannel = makeNewChannel('text');

‎tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ function f15() {
178178
> : ^^^^^^
179179
>b4 : number
180180
> : ^^^^^^
181-
>c4 : true
182-
> : ^^^^
181+
>c4 : boolean
182+
> : ^^^^^^^
183183
}
184184
var { a4, b4, c4 } = f15();
185185
>a4 : string

‎tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function f15() {
7070
> : ^^^^^^
7171
>b4 : number
7272
> : ^^^^^^
73-
>c4 : true
74-
> : ^^^^
73+
>c4 : boolean
74+
> : ^^^^^^^
7575
}
7676
var { a4, b4, c4 } = f15();
7777
>a4 : string

‎tests/baselines/reference/declarationsAndAssignments.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,8 @@ function f15() {
823823
> : ^^^^^^
824824
>b : number
825825
> : ^^^^^^
826-
>c : true
827-
> : ^^^^
826+
>c : boolean
827+
> : ^^^^^^^
828828
}
829829

830830
function f16() {

0 commit comments

Comments
 (0)