-
Notifications
You must be signed in to change notification settings - Fork 16
/
tracer-stub.js
32 lines (26 loc) · 1.15 KB
/
tracer-stub.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
The following code has been modified by fondue to collect information about its
execution.
https://github.com/adobe-research/fondue
*/
if (typeof {name} === 'undefined') {
{name} = {};
var methods = ["add", "addSourceMap", "traceFileEntry", "traceFileExit", "setGlobal", "traceFunCreate", "traceEnter", "traceExit", "traceReturnValue", "traceExceptionThrown", "bailThisTick", "pushEpoch", "popEpoch", "augmentjQuery", "version", "connect", "nodes", "trackNodes", "untrackNodes", "newNodes", "trackHits", "trackExceptions", "trackLogs", "trackEpochs", "untrackEpochs", "trackFileCallGraph", "untrackFileCallGraph", "fileCallGraphDelta", "hitCountDeltas", "newExceptions", "epochDelta", "logCount", "logDelta", "backtrace"];
for (var i = 0; i < methods.length; i++) {
{name}[methods[i]] = function () { return arguments[0] };
}
{name}.traceFunCall = function (info) {
var customThis = false, fthis, func;
if ('func' in info) {
func = info.func;
} else {
customThis = true;
fthis = info.this;
func = fthis[info.property];
}
return function () {
return func.apply(customThis ? fthis : this, arguments);
};
};
{name}.Array = Array;
}