【发布时间】:2017-10-16 11:25:22
【问题描述】:
我从module.exports 引用我的生成器方法,但它得到arguments 数组module 不是被调用的函数。
const Promise = require('bluebird');
const inc = Promise.coroutine(function* (model, condition, fields, options = {}) {});
module.exports = {
inc: (model, condition, fields, options = {}) => {
//reveiving all the arguments fine
return inc.apply(null, arguments); //but "arguments" array contains the values of "module", not the function
}
};
arguments数组:
0 - require function
1 - Module
2 - file path
3 - directory path
【问题讨论】:
标签: javascript node.js ecmascript-6 apply