Skip to content

Commit be7deb8

Browse files
authored
Fix incorrect cast target
Found while updating #18285 to latest master. Not sure what this fixes, but it was definitely incorrect - `node` must be a `Block` at this point, so this cast must have been intended for `node.parent`, which was checked against `TryStatement` right before it.
1 parent d0168af commit be7deb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/refactors/extractSymbol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ namespace ts.refactor.extractSymbol {
375375
permittedJumps = PermittedJumps.None;
376376
break;
377377
case SyntaxKind.Block:
378-
if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (<TryStatement>node).finallyBlock === node) {
378+
if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (<TryStatement>node.parent).finallyBlock === node) {
379379
// allow unconditional returns from finally blocks
380380
permittedJumps = PermittedJumps.Return;
381381
}

0 commit comments

Comments
 (0)