Fixes #15770. The javascript source is missing the `;` character. Updates regex to allow optional semi-colon in js source.
[ci skip]
This reverts commit 7d2b4aa047.
7d2b4aa047