-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary IIFEs pervasive in v4 implementation #139
Comments
The method is used because there is no cross-browser But I am open to any code suggestion you might have, consider backward compatibility as well. |
@thednp I'm not referring to the (function () {
// code...
})(); As for that bug fix, all you really did beyond adding the unnecessary IIFEs was move code into As for backwards compatibility, just inlining their bodies should have zero impact, even as far back as Netscape. Any differences would be obvious browser breakers, leaving almost all common sites with scripting unusable. |
@isiahmeadows as I said, I am open to any code suggestion, I really tried them all I know. |
Wowow, wait a sec and check this first before committing. Have you tested multiple clicks and it works perfect? I've spent about 2 days working to fix that issue, you think that would simplify and solve the issue for good? Also make sure the events are triggered when they should really trigger :) |
It's equivalent to what's already there, and I have tested it to verify it does not break in Chrome. |
I am now testing your code in all browsers. It seems to work, but I don't know... |
In case you're curious (I can tell you're not super familiar with the difference), here's the Wikipedia article on the idiom. |
OK. I remember now. FYI: I am not targeting G Chrome only, I am interested in IE8+ for BSN V3 and IE10+ for BSN V4. I also have a very old Safari for Windows.... My wild code there is meant to make it work in all the browsers consistently. So, you know why those IIFEs are used? It's because the API on So FYI, please take the time to test differences with all functionalities in regards to components custom events, browsers, consistency, etc ;) |
@chenull I hope you take a look at @isiahmeadows' commit as well. Thank you. |
@thednp IIFE's are just a lanugage idiom, unique to JS the language, without respect to the environment. They do literally nothing apart from creating a new scope for |
@isiahmeadows I will certainly do a mega test with your suggestion as soon as I get some time. Thank you. |
I was just looking at the source out of curiosity, and found a lot of seemingly unnecessary IIFEs in the collapse (1, 2) and tab (1, 2, 3, 4, 5, 6) implementations. Is there a particular reason for these, or should they be removed?
The text was updated successfully, but these errors were encountered: