others just omit this and put in all their code without an IIFE expression.(function() {
// plugin code //
})();
Both seems to work most of the time. As far as I have understood it the reson to use IIFE is to hide variables inside its scope and not make them global on accident, is that correct?// plugin code //
works, howeverfunction Scene_Warfare() {
this.initialize.apply(this, arguments);
};
Scene_Warfare.prototype = Object.create(Scene_Base.prototype);
Scene_Warfare.prototype.constructor = Scene_Warfare;
...
doesn't and just leads to the error "Scene_Warfare is not defined".(function() {
function Scene_Warfare() {
this.initialize.apply(this, arguments);
};
Scene_Warfare.prototype = Object.create(Scene_Base.prototype);
Scene_Warfare.prototype.constructor = Scene_Warfare;
...
})();