UNPKG

haxe

Version:

Wrapper of Haxe, an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.

28 lines (25 loc) 687 B
var path = require('path'); var TaskRunner = function(){ this.taskList = []; this.currentTaskIndex = 0; this.run = function () { var exitTask = { run: function () { console.log("END"); process.exit(0); } }; this.addTask(exitTask); this.taskList[0].run(this.delegate(this)); }; this.addTask = function (task) { this.taskList.push(task); }; this.delegate = function(self){ return function () { self.currentTaskIndex++; self.taskList[self.currentTaskIndex].run(self.delegate(self)); }; } } module.exports.TaskRunner = TaskRunner;