Jessie icon indicating copy to clipboard operation
Jessie copied to clipboard

named arguments idiom: passing fresh mutable objects?

Open dckc opened this issue 2 years ago • 0 comments

I was looking at some code carefully, in particular a call using "named arguments":

addBidCommand(interCmd, { tui, makeRpcClient, agd });

Is this allowed in Jessie? Could/should it be? It's statically evident that the caller no longer has access to the object and hence cannot mutate it.

Using object destructuring for "named arguments" is, IIUC, a best practice to manage more than 2 or 3 args in a function.

Callees don't assume their args are hardened, right? Jessie functions are callable from non-Jessie code, yes?

dckc avatar Jun 16 '23 13:06 dckc