这个问题在这里已经有了答案:MethodsinES6objects:usingarrowfunctions(6个答案)关闭4年前。我必须使用基于回调的API,但我想保留我的异步函数。这就是为什么我要尝试编写depromisify函数:constdepromisify=fn=>{if(!(fn[Symbol.toStringTag]==='AsyncFunction')){returnfn;}//Canbe`async`asthecallerwon'tuseassignmenttogettheresult-it'sallboundtothe`cb`returnasyncfunction(