tc39 / proposal-function-implementation-hiding

JavaScript language proposal: function implementation hiding

Home Page:https://ci.tc39.es/preview/tc39/ecma262/pull/1739

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A possible syntax form

jithujoshyjy opened this issue · comments

I'm curious to know if it would be better to have a syntax for this requirement;
Maybe something like:

async function connectToDB(connStr) #{
    return await orm.connect(connStr)
}

(It kindof looks ungly😅)

The benefit of using a directive instead of new syntax is that it is backward-compatible, which will make adoption significantly easier.