Open zba opened 8 years ago
Maybe it should use window
instead?
Anything using Function
for evaluating code to global "this" is imho sufficiently far way from any responsible coding standard that I can't consider it.
Perhaps it makes more sense to simply pass window
here since this jQuery plugin has no sensible use case outside a browser environment (unlike jQuery core, for example).
For comparison, jQuery core settled on the following https://github.com/jquery/jquery/pull/1476:
typeof window !== "undefined" ? window : this
Oh, 9years ago. No, you shall not set it like is your comment, because that shall guarantee, that you not in binded function, correct way is to create function and return "this". I think eval was made to worship linter.
in case of use browserify it fail with 'Cannot use 'in' operator to search for 'onhashchange' in undefined' because window is undefined. this patch fixes it.