Throw descriptive error for Invalid RegExp

Throws up descriptive error when parsing an invalid regular expression 
"test".match(/test/i || /test2/i);