Skip to content

arthurfiorette/proposal-try-operator

Repository files navigation


ECMAScript Try Expressions

Warning

After a log of discussion and feedback, the proposal was renamed from Safe Assignment Operator to Try Expressions.


ECMAScript Try Expressions Proposal

This proposal intends to address a surging issue regarding the uncommon ergonomics of maintaining subsequent (and possible nested) try/catch blocks required to correctly execute operations that might fail at any point.

Only the catch (error) {} part is the actual control flow and no program state requires to be within a try {} block. Forcing the successful flow to be inside a nested block is not ideal.




Help Us Improve This Proposal

This proposal is in its early stages, and we welcome your input to help refine it. Please feel free to open an issue or submit a pull request with your suggestions.

Any contribution is welcome!


Authors


Inspiration


License

This proposal is licensed under the MIT License.