Skip to content

Instantly share code, notes, and snippets.

@bunopus
Created May 18, 2018 11:22
Show Gist options
  • Save bunopus/a91b6b43de009f9cce3b6d5e48205703 to your computer and use it in GitHub Desktop.
Save bunopus/a91b6b43de009f9cce3b6d5e48205703 to your computer and use it in GitHub Desktop.
Example for HolyJS TCXX

Add 🐈(cat) prefix to functions

Motivation

Functions or methods, marked with 🐈 do not throw exceptions. In case of error - 🐈 will be thrown.

function 🐈myFunction()

High-level API

var 🐈myFunction = () => { throw 'Bad bad exception' }

try {
  myFunction();
} catch (err) {
  console.log(err); // 🐈
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment