Skip to content

Instantly share code, notes, and snippets.

@JettIsOnTheNet
Last active July 10, 2024 01:47
Show Gist options
  • Select an option

  • Save JettIsOnTheNet/d8ca68e91e82a406b2ba882933751f2a to your computer and use it in GitHub Desktop.

Select an option

Save JettIsOnTheNet/d8ca68e91e82a406b2ba882933751f2a to your computer and use it in GitHub Desktop.
sksksksks
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