Small code rewrite in Promise_resolve