Commit 326185dd 326185dd69f34bf232b7f6aa7b68950d6911a049 by Nathan Black

undo double error event emitting from modules/casper.js@76b7f73 and the extra c…

…oupling in the onError handler
1 parent 5d9f0ea0
......@@ -180,9 +180,6 @@ var Casper = function Casper(options) {
this.initErrorHandler();
this.on('error', function(msg, backtrace) {
if (/^(Assertion|Termination|TimedOut)Error/.test(msg)) {
return;
}
var c = this.getColorizer();
var match = /^(.*): __mod_error(.*):: (.*)/.exec(msg);
var notices = [];
......@@ -387,7 +384,6 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) {
}
} catch (error) {
self.emit('complete.error', error);
this.emit('error', error);
}
};
......@@ -1535,7 +1531,6 @@ Casper.prototype.runStep = function runStep(step) {
}
} catch (err) {
this.emit('step.error', err);
this.emit('error', err);
}
if (!skipLog) {
this.emit('step.complete', stepResult);
......
......@@ -276,12 +276,12 @@ class TestCommandOutputTest(CasperExecTestBase):
script_path,
'# step throws',
'FAIL Error: oops!',
'# type: error',
'# type: uncaughtError',
'# file: %s:5' % script_path,
'# error: oops!',
'FAIL 2 tests executed', # this is another bug
'FAIL 1 test executed',
'0 passed',
'2 failed',
'1 failed',
'0 dubious',
'0 skipped',
], failing=True)
......