You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that when hashmap is minified, this.type doesn't work correctly. The reason is the automatic chaining which does the followin check:
if (fn.toString().indexOf('return ') === -1) {
proto[method] = chain(fn);
}
In minified code, it seems type is transformed into this:
type: function(t) {var e = Object.prototype.toString.call(t), n = e.slice(8, -1).toLowerCase();return"domwindow" !== n || t ? n : t + ""}
Because there's no space between return and "domwindow", the check causes type to be chained, returning this instead of the correct return value.
I propose that you explicitly list the names of the methods you want to chain instead of doing checks based on the structure of the function. But why did you have the space after return in that string to check anyway?
The text was updated successfully, but these errors were encountered:
I saw the PR before this, I think we just have the PR.
Anyway, we could also change return to return. But in all truth, while I like the nifty auto-detection, it's simply less code to just hardcode the names.
I've noticed that when hashmap is minified,
this.type
doesn't work correctly. The reason is the automatic chaining which does the followin check:In minified code, it seems type is transformed into this:
type: function(t) {var e = Object.prototype.toString.call(t), n = e.slice(8, -1).toLowerCase();return"domwindow" !== n || t ? n : t + ""}
Because there's no space between return and "domwindow", the check causes type to be chained, returning
this
instead of the correct return value.I propose that you explicitly list the names of the methods you want to chain instead of doing checks based on the structure of the function. But why did you have the space after return in that string to check anyway?
The text was updated successfully, but these errors were encountered: