Last active
July 10, 2024 01:47
-
-
Save JettIsOnTheNet/d8ca68e91e82a406b2ba882933751f2a to your computer and use it in GitHub Desktop.
sksksksks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function yeet(error) { | |
| throw error; | |
| } | |
| const drag = { | |
| log: (...args) => console.log(...args), | |
| error: (...args) => console.error(...args), | |
| warn: (...args) => console.warn(...args), | |
| info: (...args) => console.info(...args) | |
| }; | |
| class Tea extends Error { | |
| constructor(message) { | |
| super(message); | |
| this.name = 'Tea'; | |
| } | |
| } | |
| function sus(tryBlock) { | |
| return { | |
| ick: function(catchBlock) { | |
| return { | |
| hopoff: function(finallyBlock) { | |
| try { | |
| tryBlock(); | |
| } catch (tea) { | |
| catchBlock(tea); | |
| } finally { | |
| finallyBlock(); | |
| } | |
| }, | |
| hopoff: function() { | |
| try { | |
| tryBlock(); | |
| } catch (tea) { | |
| catchBlock(tea); | |
| } | |
| } | |
| }; | |
| }, | |
| hopoff: function(finallyBlock) { | |
| try { | |
| tryBlock(); | |
| } catch (tea) { | |
| yeet(tea); | |
| } finally { | |
| finallyBlock(); | |
| } | |
| } | |
| }; | |
| } | |
| // FRFR | |
| sus(() => { | |
| yeet(new Tea("spillt")); | |
| }).ick((tea) => { | |
| drag.log('drama:', tea.message); | |
| }).hopoff(() => { | |
| drag.log('bet.'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment