Update parser.js

parse function should not throw errors
Merge pull request #1578 from yanni4night/master

Update parser.js to not throw exceptions