Skip to content

Attempt to parse error name when no 5th error arg (fixes #535) #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2016

Conversation

benvinegar
Copy link
Contributor

This should improve exception data from Android Browser 4 - 4.3, IE 8 and IE 9.

I'm sure the regex is pretty naive and needs some looking over.

cc @mattrobenolt

Correction: While IE8 and IE9 don't support a 5th error argument for onerror, their error messages don't contain the error type. For example, IE9 says 'foo' is undefined and omits any mention of ReferenceError.

window.onerror = function(message) {
if (message == testMessage) {
window.onerror = function(message, url, lineNo) {
if (message == testMessage || lineNo === 1337) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ignore me. This is a fixture.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this relied on passing a unique message to prevent bubbling to mocha's onerror ...

But, my tests send custom messages. So I made it additionally accept a unique integer.

@benvinegar
Copy link
Contributor Author

cc @mattrobenolt – mind poking at the latest diff

name = groups[1];
msg = groups[2];
}
} catch (e) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could explode here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not guaranteed message is a string. I could verify that though.

@mattrobenolt
Copy link
Contributor

:godmode:

benvinegar added a commit that referenced this pull request Mar 22, 2016
Attempt to parse error name when no 5th error arg (fixes #535)
@benvinegar benvinegar merged commit b09d766 into master Mar 22, 2016
@benvinegar benvinegar deleted the no-undefined-name branch March 22, 2016 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants