Fix unintended error catching in parser.js

Hi :)

This patch fixes an unintended behavior in the parser.

The JSON.parse() call is wrapped in a try catch block to catch parser errors, which is fine.

However, the emit('element') call is also wrapped inside this, so that any error thrown in the event chain this starts will be caught here, too.