Skip to content

return-based syntax #31

@ThiefMaster

Description

@ThiefMaster

It would be nice to have a return-based syntax to make async programming even more comfortable.

function foo(host) {
    await dns.resolve(host, 'A', defer(var err, ip));
    return ip;
}

var ip = await foo('github.com');

Implementing it should be rather easy since all the preprocessor has to do is transforming the code like this before performing whatever it already does:

function foo(host, cb) {
    await dns.resolve(host, 'A', defer(var err, ip));
    cb(ip);
}

await foo('github.com', defer(var ip));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions