Open johnd0e opened 5 years ago
function
-object?
Why do not write just
var self = {}; // instead of function() {}
?
I can imagine a reason: for monkey-patching plugin's internal functions, in order to customize or extend them. Don't I miss other possible reasons?
If I don't, that should we expose in namespace every internal function? Wouldn't be better something like this: https://github.com/IITC-CE/ingress-intel-total-conversion/pull/40/commits/4e9ca02cfa4565496f10950030ecaab0f428dad0?
So wouldn't be better do like this: https://github.com/IITC-CE/ingress-intel-total-conversion/pull/40/commits/9ab75a8548b6a02ae94abc11ad74a29fbdb34e14?
I've seen your similar question in the parent repository, but I don't have an answer as to why it's done this way. If the work does not break in browsers and does not violate backward compatibility with third-party scripts, I think you can safely change
Well, it definitely does not break anything in my experiments, but my testing is rather limited..
I think we should not make such changes globally yet (at least until #2 is completed). I propose to consider this issue as step to general future code clean up.
Meanwhile, if there are no objections, I could apply this locally, to that parts of code that I am rewriting now anyway.
Agreed. I will carefully test and if something breaks, I will inform
I found possible explanations. of that long function references.
I have understood the reasons, but still not accepted them, as it is really ugly. Errors occurs not so often, and I better will use debugger to see the their source.
What do you think?
In my opinion, for plugins we should avoid such namespace usage.
As a PoC #445 implements all functions as local functions and explicitly exposes some of them.
I have several conceptual questions regarding functions naming etc. So the 1st:
window.plugin.showLinkedPortal.previewOptions
(it's also inconsistent as somewhere there are references w/owindow.
prefix).Shouldn't we fix it, like here: https://github.com/IITC-CE/ingress-intel-total-conversion/commit/c1aec193c74800c0258c29d39cb09fa6422966fb?