Namespace: WrapperTracer

WrapperTracer~WrapperTracer

logo

It creates a WRAPPER OBJECT that tracks the methods execution of other objects. Serves of 'TRACER' to obtain a visual representation of execution cycle of the methods, as well as help with information (elapsed time, nesting, types of methods, parameters, ...). With only two parameters required: The 'original object' and the 'DOM container' element, we obtain the 'wrapped' object and all visual inteface.

The constructor allows three parameters:

  • {Object} obj - The Javascript object to wrap.
  • {HTMLElement|string} container - The 'HTMLElement' or your 'Element' which will serve as container for all UI.
  • {Function} callback [OPTIONAL] - The function to embed in each object methods.

TESTED ON :: http://jsperf.com/wrapper-compare/3

Version:
  • 1.0.0b
Author:
  • GuerraTron - 2015. <dinertron@gmail.com> - GPL-v3
Source:

Example

To Wrap a JS object.

//Gets the Wrapper and builds entire interface in the 'idElement' element
var wrapper = new WrapperTracer(objJS, 'idElement', null);
//Gets the wrapped
var wrapped = wrapper.getWrapped();
//Executes a method in the wrapped object to observe its tracking and tracing
wrapped.execBlahBlahBlah(blah, blah, blah);

Δ