JSX Spread Attributes are expression parents

Fixes #4688
This commit is contained in:
Ryan Cavanaugh
2015-09-30 13:39:40 -07:00
parent a4db4be4b6
commit 3bb66a130f
2 changed files with 27 additions and 0 deletions

View File

@@ -981,6 +981,7 @@ namespace ts {
return node === (<ComputedPropertyName>parent).expression;
case SyntaxKind.Decorator:
case SyntaxKind.JsxExpression:
case SyntaxKind.JsxSpreadAttribute:
return true;
case SyntaxKind.ExpressionWithTypeArguments:
return (<ExpressionWithTypeArguments>parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);

View File

@@ -0,0 +1,26 @@
/// <reference path='fourslash.ts' />
//@Filename: file.tsx
//// declare module JSX {
//// interface Element { }
//// interface IntrinsicElements {
//// }
//// interface ElementAttributesProperty { props }
//// }
//// class MyClass {
//// props: {
//// name?: string;
//// size?: number;
//// }
//// }
////
//// var [|/*dst*/nn|]: {name?: string; size?: number};
//// var x = <MyClass {...[|n/*src*/n|]}></MyClass>;
goTo.marker('src');
debugger;
goTo.definition();
verify.caretAtMarker('dst');
goTo.marker('src');
verify.renameLocations(false, false);