getsentry/raven-js — pull request #238 by vperron (2014-08-06 19:00:51+00:00)
Title: Make Tracekit report correctly angularJS errors

Hi,

I'm pretty sure there are some issues in the way this commit is done (no version bump, etc) but I noticed the stack frames corresponding to something like:

ReferenceError: xxx is not defined
at new (http://127.0.0.1:3333/js/app.js:12354:19)
at invoke (http://127.0.0.1:3333/js/vendor.js:29215:17)
at Object.instantiate (http://127.0.0.1:3333/js/vendor.js:29226:23)
at http://127.0.0.1:3333/js/vendor.js:32625:28

were silently skipped in Tracekit, because of the two words "new ".

This patch enhances (and in the end, simplifies) the regular expression that was used to decode the stack frames in Chrome. It was checking for 0-1 occurrences of [object], then some non-space chars, then 0-1 occurrences of [as xxx], but included everything in the same capture group.
I just capture what's before the first opening parenthesis.

Other methods (gecko-based detection) seem fine. Test has been added.