Steps to replicate the issue (include links if applicable):
- Updated definition: https://pl.wikipedia.org/w/index.php?title=MediaWiki%3AGadgets-definition&diff=70967924&oldid=70847009
- Added some updates in code. Some semicolons were missing, but unminified code was valid..
What happens?:
This code caused parsing error and multiple gadgets were broken:
$G.saveState = function(state) { console.log('[replylinks]', 'saveState', state); localStorage.setItem($G._stateKey, JSON.stringify(state)); }$G.readState = function() { var rawState = localStorage.getItem($G._stateKey); var state = JSON.parse(rawState); console.log('[replylinks]', 'readState', state); return state; }
Adding semicolons fixed this:
https://pl.wikipedia.org/w/index.php?title=MediaWiki:Gadget-replylinks.js&diff=prev&oldid=70981634
What should have happened instead?:
Minification/obfuscation must produce equivalent code.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
Firefox.
Chrome.
Also in VSC.