copy of mixin_promise.js