mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Oops. Fix stupid error in lifecycle.
This commit is contained in:
@@ -11,19 +11,21 @@ function Lifecycle() {
|
||||
}
|
||||
|
||||
Lifecycle.prototype.share = function(name, emitter, options) {
|
||||
_.defaults(options, {
|
||||
end: true
|
||||
, error: true
|
||||
})
|
||||
var opts = _.assign({
|
||||
end: true
|
||||
, error: true
|
||||
}
|
||||
, options
|
||||
)
|
||||
|
||||
if (options.end) {
|
||||
if (opts.end) {
|
||||
emitter.on('end', function() {
|
||||
log.fatal('%s ended; we shall share its fate', name)
|
||||
this.fatal()
|
||||
}.bind(this))
|
||||
}
|
||||
|
||||
if (options.error) {
|
||||
if (opts.error) {
|
||||
emitter.on('error', function(err) {
|
||||
log.fatal('%s had an error', name, err.stack)
|
||||
this.fatal()
|
||||
|
||||
Reference in New Issue
Block a user