1 | var define;
|
2 | if (typeof define === "undefined")
|
3 | define = function (classInstance) {
|
4 | classInstance (require, exports, module);
|
5 | }
|
6 |
|
7 | define (function (require, exports, module) {
|
8 |
|
9 | var task = require('./base'),
|
10 | util = require ('util');
|
11 |
|
12 |
|
13 |
|
14 | var emitTask = module.exports = function(config) {
|
15 |
|
16 | this.init (config);
|
17 |
|
18 | };
|
19 |
|
20 | util.inherits (emitTask, task);
|
21 |
|
22 | util.extend (emitTask.prototype, {
|
23 |
|
24 | run: function () {
|
25 | var self = this;
|
26 |
|
27 | if (!self.$bind || !self.$bind.on || !(self.$bind.emit instanceof Function)) {
|
28 | self.failed ('please provide $bind key in task configuration');
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 | self.$bind.emit (self.scope, self);
|
34 |
|
35 | }
|
36 | });
|
37 |
|
38 | return emitTask;
|
39 |
|
40 | });
|