Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Make it optional to wrap jQuery or async callbacks #38

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,8 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
* Extends support for global error handling for asynchronous browser
* functions. Adopted from Closure Library's errorhandler.js
*/
(function extendToAsynchronousCallbacks() {
TraceKit.wrapAsyncCallbacks = function ()
{
var _helper = function _helper(fnName) {
var originalFn = window[fnName];
window[fnName] = function traceKitAsyncExtension() {
Expand All @@ -1081,13 +1082,15 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {

_helper('setTimeout');
_helper('setInterval');
}());
};

/**
* Extended support for backtraces and global error handling for most
* asynchronous jQuery functions.
*/
(function traceKitAsyncForjQuery($) {
TraceKit.wrapJQuery = function ()
{
var $ = window.jQuery;

// quit if jQuery isn't on the page
if (!$) {
Expand Down Expand Up @@ -1141,8 +1144,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
throw e;
}
};

}(window.jQuery));
};

//Default options:
if (!TraceKit.remoteFetching) {
Expand Down