File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -486,8 +486,8 @@ namespace ts.refactor.extractSymbol {
486486 // but a super *method call* simply implies a 'this' reference
487487 if ( node . parent . kind === SyntaxKind . CallExpression ) {
488488 // Super constructor call
489- const containingClass = getContainingClass ( node ) ! ; // TODO:GH#18217
490- if ( containingClass . pos < span . start || containingClass . end >= ( span . start + span . length ) ) {
489+ const containingClass = getContainingClass ( node ) ;
490+ if ( containingClass === undefined || containingClass . pos < span . start || containingClass . end >= ( span . start + span . length ) ) {
491491 ( errors ||= [ ] ) . push ( createDiagnosticForNode ( node , Messages . cannotExtractSuper ) ) ;
492492 return true ;
493493 }
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ /////*a*/super()/*b*/
4+
5+ goTo . select ( "a" , "b" ) ;
6+ verify . not . refactorAvailable ( "Extract Symbol" ) ;
You can’t perform that action at this time.
0 commit comments