Skip to content

Commit 2710ccc

Browse files
committed
Use non-string check instead of object check
1 parent 538d1a5 commit 2710ccc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

vendor/TraceKit/tracekit.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function getLocationHref() {
3535
return document.location.href;
3636
}
3737

38+
3839
/**
3940
* TraceKit.report: cross-browser processing of unhandled exceptions
4041
*
@@ -152,10 +153,8 @@ TraceKit.report = (function reportModuleWrapper() {
152153
if (lastExceptionStack) {
153154
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
154155
processLastException();
155-
} else if (ex && typeof ex === 'object') {
156-
// intentionally a "weak" object check here - want to accept
157-
// Error-like objects just in case (previously *any* truthy ex value)
158-
// triggered this branch
156+
} else if (ex && {}.toString.call(ex) !== '[object String]') {
157+
// non-string `ex` arg; attempt to extract stack trace
159158

160159
// New chrome and blink send along a real error object
161160
// Let's just report that like a normal error.

0 commit comments

Comments
 (0)