Skip to content

Commit 3bb66a1

Browse files
committed
JSX Spread Attributes are expression parents
Fixes microsoft#4688
1 parent a4db4be commit 3bb66a1

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

src/compiler/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ namespace ts {
981981
return node === (<ComputedPropertyName>parent).expression;
982982
case SyntaxKind.Decorator:
983983
case SyntaxKind.JsxExpression:
984+
case SyntaxKind.JsxSpreadAttribute:
984985
return true;
985986
case SyntaxKind.ExpressionWithTypeArguments:
986987
return (<ExpressionWithTypeArguments>parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
//@Filename: file.tsx
4+
//// declare module JSX {
5+
//// interface Element { }
6+
//// interface IntrinsicElements {
7+
//// }
8+
//// interface ElementAttributesProperty { props }
9+
//// }
10+
//// class MyClass {
11+
//// props: {
12+
//// name?: string;
13+
//// size?: number;
14+
//// }
15+
//// }
16+
////
17+
//// var [|/*dst*/nn|]: {name?: string; size?: number};
18+
//// var x = <MyClass {...[|n/*src*/n|]}></MyClass>;
19+
20+
goTo.marker('src');
21+
debugger;
22+
goTo.definition();
23+
verify.caretAtMarker('dst');
24+
25+
goTo.marker('src');
26+
verify.renameLocations(false, false);

0 commit comments

Comments
 (0)