Opened 7 months ago
#6881 new task
Remove this[name] = new this[name] loops.
Reported by: | phosit | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 27 |
Component: | UI & Simulation | Keywords: | JS |
Cc: | Patch: |
Description
There is this loop in binaries/data/mods/public/gui/maps/mapbrowser/controls/MapBrowserControls.js
for (let name in this) this[name] = new this[name](mapBrowserPage, gridBrowser);
That loop prevents the addition of non constructor properties to MapBrowserPageControls
and it's prototype.
There are also such loops in binaries/data/mods/public/gui/gamesetup/.
The intention of such loops is to be extensible (one can add a constructor) and modifiable (one can edit or overwrite the constructors).
If we want to keep this kind of modability. The container (which holds the constructors) should not do anything but hold the constructors. The container might also be a Map
.
Note:
See TracTickets
for help on using tickets.