An implementation for promise/A+