can't assume this is always window.

Got error when using module with bower an browserify.
reformatted