Check for Error.captureStackTrace before use
Merge pull request #2 from OlavHN/master

Error.captureStackTrace not available in browsers