Don't fail on invalid JS syntax in event handlers.

Fixes #2862.
Merge pull request #2863 from mbrubeck/2862-null-fun

Don't fail on invalid JS syntax in event handlers. r=Ms2ger