From 4aeffdcae2d078ec92274f1898d5b967d54bcbfc Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 16 Jul 2007 00:21:11 +0000 Subject: [PATCH] Slightly better handling of exceptions, especially parse errors. Bug 388248, r=gavin git-svn-id: svn://10.0.0.236/trunk@230015 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/testing/mochitest/browser-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/testing/mochitest/browser-test.js b/mozilla/testing/mochitest/browser-test.js index bd8af159d43..c4392877125 100644 --- a/mozilla/testing/mochitest/browser-test.js +++ b/mozilla/testing/mochitest/browser-test.js @@ -63,14 +63,14 @@ Tester.prototype = { var scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]. getService(Ci.mozIJSSubScriptLoader); - scriptLoader.loadSubScript(this.currentTest.path, this.currentTest.scope); - - // Run the test - var exception = null; try { + scriptLoader.loadSubScript(this.currentTest.path, this.currentTest.scope); + + // Run the test this.currentTest.scope.test(); } catch (ex) { this.currentTest.tests.push(new testResult(false, "Exception thrown", ex, false)); + this.currentTest.scope.done = true; } // If the test ran synchronously, move to the next test,