-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
window.onerror = function(message) { | ||
if (message == testMessage) { | ||
window.onerror = function(message, url, lineNo) { | ||
if (message == testMessage || lineNo === 1337) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
e9f2ab6
to
0699859
Compare
cc @mattrobenolt – mind poking at the latest diff |
name = groups[1]; | ||
msg = groups[2]; | ||
} | ||
} catch (e) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What could explode here?
There was a problem hiding this comment.
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.
0699859
to
31495ec
Compare
|
Attempt to parse error name when no 5th error arg (fixes #535)
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 ofReferenceError
.