node - this.func() is not a function
问题 function Job(name, cronString, task) { "use strict"; this.name = name; this.cronString = cronString; this.isReady = false; this.task = task; } Job.prototype.performTask = (db, winston) => { "use strict"; const Promise = require("bluebird"); let that = this; return new Promise((resolve, reject) => { let output = ""; let success = true; try { output = that.task(); } catch(error) { success = false; reject(error); } if(success) { resolve(output); } }); }; module.exports = Job; Javascript newbie