int deno_respond(DenoIsolate* d, int32_t req_id, deno_buf buf) {
if (d->current_args_ != nullptr) {
// get return value as Uint8Array
auto ab = deno::ImportBuf(d, buf);
d->current_args_->GetReturnValue().Set(ab);
d->current_args_ = nullptr;
// Asynchronous response.
// get receive callback function defined in TypeScript
auto recv_ = d->recv_.Get(d->isolate_);
d->last_exception_ = "libdeno.recv_ has not been called.";
// get return value as Uint8Array
args[0] = deno::ImportBuf(d, buf);
// call the TypeScript function
auto v = recv_->Call(context, context->Global(), 1, args);