User:Krinkle/foo.js

function foo { throw Error("Boo hoo from foo"); }

function bar { foo; }

mw.libs.bar = bar;