JSFiddle - React, Tailwind, and code Playground
by HYEONGJINKIM
JavaScript
/*! Tracing.js v1.0.0. | (c) 2013 Francisco Soto <[email protected]> | See COPYING file for more info. */
var Tracing = (function() {
/////////////////////////////////////////////////////////////////////////////////////////////
//// Global state
/////////////////////////////////////////////////////////////////////////////////////////////
var Traces = {},
globalObject = Function('return this')(),
traceDepth = 0;
// Do nothing function.
function noop () {};
/////////////////////////////////////////////////////////////////////////////////////////////
//// Predicates
/////////////////////////////////////////////////////////////////////////////////////////////
function isFunc (obj) {
return typeof(obj) === 'function';
}
function isEmpty (obj) {
return obj === undefined || obj === null;
}
function isTraced (fnName) {
return !isEmpty(Traces[fnName]);
}
function isString (obj) {
return typeof(obj) === 'string';
}
/////////////////////////////////////////////////////////////////////////////////////////////
//// Helpers
/////////////////////////////////////////////////////////////////////////////////////////////
// Converts an arguments object into an array.
function arguments2array (args) {
return copyOwnProperties(args, []);
}
// Iterate through the object properties calling the given function.
function withProperties (obj, fn) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
fn(key, obj[key]);
}
}
}
// Copies the owned properties from src to dst. Returns dst.
function copyOwnProperties (src, dst) {
withProperties(src, function(key, val) {
dst[key] = val;
});
return dst;
}
// Traverses the object defined by the string target, if val is passed
// we set last object value to this value,...