freak.js
function tracker(prop) {
    function _tracker(context) {
      return function(_prop, _arg) {
        context.deps[_prop] = context.deps[_prop] || [];
        if (!context.deps[_prop].reduce(function found(prev, curr) {
              return prev || (curr[0] === prop);
            }, false)) {
          context.deps[_prop].push([prop, instance]);
        }
        return context(_prop, _arg, true);
      }
    }
    var result = _tracker(instance);
    construct(result);
    result.parent = parent ? _tracker(parent) : null;
    result.root = _tracker(root || instance);
    return result;
  }
function tracker(prop) {
    function _tracker(context) {
      return function(_prop, _arg) {
        context.deps[_prop] = context.deps[_prop] || [];
        if (!context.deps[_prop].reduce(function found(prev, curr) {
              return prev || (curr[0] === prop);
            }, false)) {
          context.deps[_prop].push([prop, instance]);
        }
        return context(_prop, _arg, true);
      }
    }
    var result = _tracker(instance);
    construct(result);
    result.parent = parent ? _tracker(parent) : null;
    result.root = _tracker(root || instance);
    return result;
  }
function tracker ( prop ) { function _tracker ( context ) { return function ( _prop , _arg ) { context . deps [ _prop ] = context . deps [ _prop ] || [ ] ; if ( ! context . deps [ _prop ] . reduce ( function found ( prev , curr ) { return prev || ( curr [ 0 ] === prop ) ; } , false ) ) { context . deps [ _prop ] . push ( [ prop , instance ] ) ; } return context ( _prop , _arg , true ) ; } } var result = _tracker ( instance ) ; construct ( result ) ; result . parent = parent ? _tracker ( parent ) : null ; result . root = _tracker ( root || instance ) ; return result ; }
Proxy the accessor function to record all accessed properties
Proxy the accessor function to record all accessed properties