Browse files

Updated try..catch to be clearer

  • Loading branch information...
1 parent 0dabe9d commit ce6cd9ec21c3d5a7d2a451c6398e5ece1a8bd046 @lukebayes lukebayes committed Mar 15, 2010
Showing with 4 additions and 7 deletions.
  1. +4 −7 as3/src/asunit4/runners/TestRunner.as
View
11 as3/src/asunit4/runners/TestRunner.as
@@ -82,18 +82,15 @@ package asunit4.runners {
methodIsExecuting = true;
if (currentMethod.expects) {
- // TODO: [luke] Added try..catch here b/c I had a bad class name in my expects
- // is the catch here written correctly?
try {
var errorClass:Class = getDefinitionByName(currentMethod.expects) as Class;
- }
+ Assert.assertThrows(errorClass, currentMethod.value);
+ }
catch(definitionError:ReferenceError) {
+ // NOTE: [luke] Added ReferenceError catch here b/c I had a bad class name in my expects.
+ // Does this look right?
recordFailure(new Error('Could not find Reference for: ' + currentMethod.expects));
- methodIsExecuting = false;
}
- try {
- Assert.assertThrows(errorClass, currentMethod.value);
- }
catch (error:Error) {
recordFailure(error);
}

0 comments on commit ce6cd9e

Please sign in to comment.