njs_promise_object_resolve(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
    njs_index_t unused)
{
    njs_promise_t  *promise;

    if (njs_slow_path(!njs_is_object(njs_argument(args, 0)))) {
        njs_type_error(vm, "this value is not an object");
        return NJS_ERROR;
    }

    promise = njs_promise_resolve(vm, njs_argument(args, 0),
                                  njs_arg(args, nargs, 1));
    if (njs_slow_path(promise == NULL)) {
        return NJS_ERROR;
    }

    njs_set_promise(&vm->retval, promise);

    return NJS_OK;
}
njs_promise_object_resolve(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
    njs_index_t unused)
{
    njs_promise_t  *promise;

    if (njs_slow_path(!njs_is_object(njs_argument(args, 0)))) {
        njs_type_error(vm, "this value is not an object");
        return NJS_ERROR;
    }

    promise = njs_promise_resolve(vm, njs_argument(args, 0),
                                  njs_arg(args, nargs, 1));
    if (njs_slow_path(promise == NULL)) {
        return NJS_ERROR;
    }

    njs_set_promise(&vm->retval, promise);

    return NJS_OK;
}