Bug 1145049 - Fix exception when using SimpleTest.expectUncaughtException. r=ted
☠☠ backed out by beecdf8e44a4 ☠ ☠
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 15 Apr 2015 00:35:33 +0200
changeset 257379 75cc30c9a4017b48609d075408c87574f38cc0c7
parent 257378 4cf74e040c0adf7a2dcd5bf120aa17cbad6c5140
child 257380 145f6347bb119c65198bb1e7f105574413e2c0bf
push id1541
push usermichael.l.comella@gmail.com
push dateWed, 15 Apr 2015 18:43:45 +0000
reviewersted
bugs1145049
milestone40.0a1
Bug 1145049 - Fix exception when using SimpleTest.expectUncaughtException. r=ted
testing/mochitest/browser-test.js
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -904,19 +904,19 @@ function testMessage(aName) {
 // cannot conflict with global variables used in tests.
 function testScope(aTester, aTest, expected) {
   this.__tester = aTester;
   this.__expected = expected;
   this.__num_failed = 0;
 
   var self = this;
   this.ok = function test_ok(condition, name, diag, stack) {
-    if (this.__expected == 'fail') {
+    if (self.__expected == 'fail') {
         if (!condition) {
-          this.__num_failed++;
+          self.__num_failed++;
           condition = true;
         }
     }
 
     aTest.addResult(new testResult(condition, name, diag, false,
                                    stack ? stack : Components.stack.caller));
   };
   this.is = function test_is(a, b, name) {