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() {

‎tests/baselines/reference/inferenceOptionalPropertiesToIndexSignatures.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ const obj = {
124124
> : ^^^^^^^^^^^^^^^
125125
>{param2} : { param2: string; }
126126
> : ^^^^^^^^^^^^^^^^^^^
127-
>param2 : "value2"
128-
> : ^^^^^^^^
127+
>param2 : string
128+
> : ^^^^^^
129129
>{} : {}
130130
> : ^^
131131

‎tests/baselines/reference/jsExportAssignmentNonMutableLocation.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module.exports = {
2525
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
2626

2727
customSymbol,
28-
>customSymbol : unique symbol
29-
> : ^^^^^^^^^^^^^
28+
>customSymbol : symbol
29+
> : ^^^^^^
3030

3131
};
3232

‎tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function f1() {
1616
> : ^^^^^^^^^^^^^^^
1717
>{ b } : { b: boolean; }
1818
> : ^^^^^^^^^^^^^^^
19-
>b : true
20-
> : ^^^^
19+
>b : boolean
20+
> : ^^^^^^^
2121

2222
// Desired: OK
2323
// 3.0: OK

‎tests/baselines/reference/shorthand-property-es5-es6.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ const bar = { foo, baz };
1818
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
>foo : any
2020
> : ^^^
21-
>baz : 42
22-
> : ^^
21+
>baz : number
22+
> : ^^^^^^
2323

‎tests/baselines/reference/shorthand-property-es6-amd.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ const bar = { foo, baz };
1818
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
>foo : any
2020
> : ^^^
21-
>baz : 42
22-
> : ^^
21+
>baz : number
22+
> : ^^^^^^
2323

‎tests/baselines/reference/shorthand-property-es6-es6.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ const bar = { foo, baz };
1818
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
>foo : any
2020
> : ^^^
21-
>baz : 42
22-
> : ^^
21+
>baz : number
22+
> : ^^^^^^
2323

‎tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function foo () {
1616
> : ^^^^^^^^^^^^^^^^^
1717
>{ test } : { test: string; }
1818
> : ^^^^^^^^^^^^^^^^^
19-
>test : "test"
19+
>test : string
2020
> : ^^^^^^
2121
}
2222

‎tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function foo () {
1616
> : ^^^^^^^^^^^^^^^^^
1717
>{ test } : { test: string; }
1818
> : ^^^^^^^^^^^^^^^^^
19-
>test : "test"
19+
>test : string
2020
> : ^^^^^^
2121
}
2222

‎tests/baselines/reference/systemObjectShorthandRename.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const x2 = {x}
1717
> : ^^^^^^^^^^^^^^
1818
>{x} : { x: string; }
1919
> : ^^^^^^^^^^^^^^
20-
>x : "X"
21-
> : ^^^
20+
>x : string
21+
> : ^^^^^^
2222

2323
const a = {x2}
2424
>a : { x2: { x: string; }; }
@@ -39,6 +39,6 @@ const b = {x3}
3939
> : ^^^^^^^^^^^^^^^
4040
>{x3} : { x3: string; }
4141
> : ^^^^^^^^^^^^^^^
42-
>x3 : "X"
43-
> : ^^^
42+
>x3 : string
43+
> : ^^^^^^
4444

‎tests/cases/compiler/capturedShorthandPropertyAssignmentNoCheck.ts

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

0 commit comments

Comments
 (0)