AGPL fixes this problem for <i>backend</i> code running on the web server, which is technically not distributed, so GPLv2 does not apply.  For Javascript code, the code <i>is</i> distributed to the web browser, so even GPLv2 applies.