Fix incorrect cast target (#19093)

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.
This commit is contained in:
Wesley Wigham
2017-10-11 14:52:23 -07:00
committed by GitHub
parent 917ae32937
commit 9f4130b204

View File

@@ -375,7 +375,7 @@ namespace ts.refactor.extractSymbol {
permittedJumps = PermittedJumps.None;
break;
case SyntaxKind.Block:
if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (<TryStatement>node).finallyBlock === node) {
if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (<TryStatement>node.parent).finallyBlock === node) {
// allow unconditional returns from finally blocks
permittedJumps = PermittedJumps.Return;
}