throw TypeError if fn.toString match returns null

* this is a better error than: `Uncaught TypeError: Cannot read property '1' of null `
* this happened to me when my js was run through a minifier and comments were stripped out.  A better error would have made debugging easier