tc39 / proposal-function-implementation-hiding

JavaScript language proposal: function implementation hiding
https://ci.tc39.es/preview/tc39/ecma262/pull/1739
MIT License
98 stars 7 forks source link

A possible syntax form #51

Open jithujoshyjy opened 1 year ago

jithujoshyjy commented 1 year ago

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😅)

michaelficarra commented 1 year ago

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