cowboy / jquery-hashchange

This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.
http://benalman.com/projects/jquery-hashchange-plugin/
GNU General Public License v2.0
1.21k stars 258 forks source link

named function expression #8

Closed tbranyen closed 14 years ago

tbranyen commented 14 years ago

In self.start there is a named function expression: loopy which will cause issues in IE browsers, but more specifically the blackberry browser. One possible solution is to remove the function name and use arguments.callee... although I'm not sure if this is kosher.

cowboy commented 14 years ago

Lark, afaik in IE, the NFE name might leak out of scope, but shouldn't have any other issues. And of course, it doesn't need to be an NFE (I just happen to like that pattern).

What do these 3 lines output for you in the Blackberry browser?

(function x(){ alert( typeof x ); })();
var y; (y = function(){ alert( typeof y ); })();
function z(){ alert( typeof z ); }; z();
tbranyen commented 14 years ago

undefined, function, function

cowboy commented 14 years ago

This bug appears to have been fixed as a side-effect of c164cce3978fcf0ead8f52f954c7dd9c7a9e43ae, so I'm closing it!

kangax commented 13 years ago

@lark Which version of a Blackberry is it?

tbranyen commented 13 years ago

@kangax 4.6

kangax commented 13 years ago

@lark Hm, this is the latest one, isn't it (do you know which model)? It would be pretty sucky if latest blackberry isn't able to create NFE properly.

tbranyen commented 13 years ago

Nope, latest is 6. 5 came in between that and doesn't have this issue. 4.6 is like the IE 6 of mobile web, so its hardly relevant. Even jQuery mobile is ignoring it due to currentStyle reflow issues.

kangax commented 13 years ago

Gotcha.

I remember having other NFE "issues" in Blackberry but unfortunately haven't documented which version it was :/ http://kangax.github.com/nfe/#spidermonkey-peculiarity