Skip to content

Instantly share code, notes, and snippets.

@mutoo
Last active September 10, 2019 00:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mutoo/195200f073fc270b9ab763bdc699b8f5 to your computer and use it in GitHub Desktop.
Save mutoo/195200f073fc270b9ab763bdc699b8f5 to your computer and use it in GitHub Desktop.
Roses are red, violets are blue. Unexpected token { at line 32.
// inspired by https://twitter.com/nixcraft/status/1162020669242003456
console.log('Roses are red, violets are blue.');
// ooooooooo.
// `888 `Y88.
// 888 .d88' .ooooo. .oooo.o .ooooo. .oooo.o .oooo. oooo d8b .ooooo.
// 888ooo88P' d88' `88b d88( "8 d88' `88b d88( "8 `P )88b `888""8P d88' `88b
// 888`88b. 888 888 `"Y88b. 888ooo888 `"Y88b. .oP"888 888 888ooo888
// 888 `88b. 888 888 o. )88b 888 .o o. )88b d8( 888 888 888 .o
// o888o o888o `Y8bod8P' 8""888P' `Y8bod8P' 8""888P' `Y888""8o d888b `Y8bod8P'
// .o8 o8o oooo .
// "888 `"' `888 .o8
// oooo d8b .ooooo. .oooo888 oooo ooo oooo .ooooo. 888 .ooooo. .o888oo .oooo.o
// `888""8P d88' `88b d88' `888 `88. .8' `888 d88' `88b 888 d88' `88b 888 d88( "8
// 888 888ooo888 888 888 `88..8' 888 888 888 888 888ooo888 888 `"Y88b.
// 888 888 .o 888 888 .o. `888' 888 888 888 888 888 .o 888 . o. )88b
// d888b `Y8bod8P' `Y8bod88P" Y8P `8' o888o `Y8bod8P' o888o `Y8bod8P' "888" 8""888P'
// '
// .o8 oooo
// "888 `888
// .oooo. oooo d8b .ooooo. 888oooo. 888 oooo oooo .ooooo.
// `P )88b `888""8P d88' `88b d88' `88b 888 `888 `888 d88' `88b
// .oP"888 888 888ooo888 888 888 888 888 888 888ooo888
// d8( 888 888 888 .o 888 888 888 888 888 888 .o
// `Y888""8o d888b `Y8bod8P' `Y8bod8P' o888o `V88V"V8P' `Y8bod8P'
try {
eval('function {');
} catch(e) {
let [_, lineno] = e.stack.match(/:(\d+):(\d+)/);
console.error(`${e.message} at line ${lineno}.`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment