@@ -2778,7 +2778,7 @@ module ts {
2778
2778
}
2779
2779
2780
2780
function getThrowOccurrences ( throwStatement : ThrowStatement ) {
2781
- var owner = getContextualThrowStatementOwner ( throwStatement ) ;
2781
+ var owner = getThrowStatementOwner ( throwStatement ) ;
2782
2782
2783
2783
if ( ! owner ) {
2784
2784
return undefined ;
@@ -2817,12 +2817,12 @@ module ts {
2817
2817
else if ( node . kind === SyntaxKind . TryStatement ) {
2818
2818
var tryStatement = < TryStatement > node ;
2819
2819
2820
- // If a try statement has a catch clause, then any thrown exceptions in the try block
2821
- // will be propagated to the next owner.
2822
2820
if ( tryStatement . catchBlock ) {
2823
2821
aggregate ( tryStatement . catchBlock ) ;
2824
2822
}
2825
2823
else {
2824
+ // Exceptions thrown within a try block lacking a catch clause
2825
+ // are "owned" in the current context.
2826
2826
aggregate ( tryStatement . tryBlock ) ;
2827
2827
}
2828
2828
@@ -2838,11 +2838,11 @@ module ts {
2838
2838
}
2839
2839
2840
2840
/**
2841
- * For lack of a better name, this function takes a throw statement and returns the first
2842
- * encountered ancestor that is a try-block (whose try statement has a catch clause),
2841
+ * For lack of a better name, this function takes a throw statement and returns the
2842
+ * nearest ancestor that is a try-block (whose try statement has a catch clause),
2843
2843
* function-block, or source file.
2844
2844
*/
2845
- function getContextualThrowStatementOwner ( throwStatement : ThrowStatement ) : Node {
2845
+ function getThrowStatementOwner ( throwStatement : ThrowStatement ) : Node {
2846
2846
var child : Node = throwStatement ;
2847
2847
2848
2848
while ( child . parent ) {
0 commit comments