After I started writing code  extensively using async-await I have noticed
that I would like to have automated way of dealing with resource management.

Scope-level manage was proven (Python, C++, Java at least) to be intuitive
and error proof.

Previous discussion on this topic: https://esdiscuss.
org/topic/resource-management

Example syntax:

try with Expression as Identifier {

} catch... finally...

Symbol.open and Symbol.close methods would be called respectively on
entering and leaving try block.

Plays well with both synchronous and asynchronous resource access.

Another option is to reuse with:

with(expression as identifier) {

}

Though it would be confusing to statement with wildly different semantics
in strict mode.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to