Replace 'instanceof' for IE8 users

Summary: `instanceof` doesn't work in IE8 using our weird Error stuff,
just rewrite it to manually check if the error is a ParseError.

Auditors: alpert