From fc469538da2c58063e4aaa0e98edfcc48865b14a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 30 Sep 2014 13:49:45 -0700 Subject: [PATCH] Minor naming/comment changes. --- src/services/services.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index dc6b6353ef3..264d0bc816e 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2778,7 +2778,7 @@ module ts { } function getThrowOccurrences(throwStatement: ThrowStatement) { - var owner = getContextualThrowStatementOwner(throwStatement); + var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; @@ -2817,12 +2817,12 @@ module ts { else if (node.kind === SyntaxKind.TryStatement) { var tryStatement = node; - // If a try statement has a catch clause, then any thrown exceptions in the try block - // will be propagated to the next owner. if (tryStatement.catchBlock) { aggregate(tryStatement.catchBlock); } else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. aggregate(tryStatement.tryBlock); } @@ -2838,11 +2838,11 @@ module ts { } /** - * For lack of a better name, this function takes a throw statement and returns the first - * encountered ancestor that is a try-block (whose try statement has a catch clause), + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), * function-block, or source file. */ - function getContextualThrowStatementOwner(throwStatement: ThrowStatement): Node { + function getThrowStatementOwner(throwStatement: ThrowStatement): Node { var child: Node = throwStatement; while (child.parent) {