Fix Javascript warnings showing up with the new SpiderMonkey
— at Version 12
The new SpiderMonkey (#1886) prints more warnings and errors about potentially buggy code. The idea is to have a close look at all these warnings and fix them in a sensible way instead of just trying to get rid of them somehow. If you know any of the affected files especially well or if you're otherwise interested to help, feel free! :) I'll focus on other TODOs for the upgrade first, but if a contributor without commit access proposes a fix, I'll review it quickly (you don't have to fix all warnings at once).
WARNING: JavaScript warning: simulation/helpers/Commands.js line 223 reference to undefined property cmd.metadata
WARNING: JavaScript warning: simulation/helpers/InitGame.js line 31 reference to undefined property settings.mapType
WARNING: JavaScript warning: simulation/components/UnitAI.js line 5268 reference to undefined property this.heldPosition
WARNING: JavaScript warning: simulation/components/TechnologyManager.js line 123 reference to undefined property template.requirements
WARNING: JavaScript warning: simulation/components/ProductionQueue.js line 540 reference to undefined property data.target
WARNING: JavaScript warning: simulation/components/ProductionQueue.js line 111 reference to undefined property template.Promotion
WARNING: JavaScript warning: simulation/components/Player.js line 479 reference to undefined property this.diplomacy[id]
WARNING: JavaScript warning: simulation/components/Player.js line 386 reference to undefined property this.diplomacy[idx]
WARNING: JavaScript warning: simulation/components/GuiInterface.js line 931 reference to undefined property this.entsRallyPointsDisplayed
WARNING: JavaScript warning: simulation/components/GuiInterface.js line 928 reference to undefined property this.entsRallyPointsDisplayed
WARNING: JavaScript warning: simulation/components/GuiInterface.js line 664 reference to undefined property template.icon
WARNING: JavaScript warning: simulation/components/Attack.js line 490 reference to undefined property missileDirection.y
WARNING: JavaScript warning: simulation/ai/common-api/map-module.js line 78 reference to undefined property this.map[(x + (y * this.width))]
WARNING: JavaScript warning: simulation/ai/common-api/map-module.js line 40 reference to undefined property this.map[(q[0] + (this.width * q[1]))]
WARNING: JavaScript warning: simulation/ai/aegis/worker.js line 148 reference to undefined property this.ent.unitAIState(...).split(...)[2]
WARNING: JavaScript warning: simulation/ai/aegis/defence.js line 146 reference to undefined property this.armyMergeSize
WARNING: JavaScript warning: simulation/ai/aegis/base-manager.js line 118 reference to undefined property HQ.basesMap.map[((x + xi) + ((y + yi) * width))]
WARNING: JavaScript warning: gui/session/selection_details.js line 214 reference to undefined property entState.attack
WARNING: JavaScript warning: gui/session/messages.js line 336 reference to undefined property msg.guid
WARNING: JavaScript warning: gui/session/input.js line 494 reference to undefined property entState.rallyPoint
WARNING: JavaScript warning: gui/session/input.js line 487 reference to undefined property entState.unitAI
WARNING: JavaScript warning: gui/session/input.js line 422 reference to undefined property entState.resourceGatherRates
WARNING: JavaScript warning: gui/session/input.js line 1086 reference to undefined property ev.hotkey
WARNING: JavaScript warning: gui/lobby/lobby.js line 580 reference to undefined property msg.from
WARNING: JavaScript warning: gui/lobby/lobby.js line 370 reference to undefined property message.from
WARNING: JavaScript warning: gui/gamesetup/gamesetup.js line 1422 reference to undefined property msg.text
In 14578: