Access private members of jQuery plugin
<p>jQuery plugins use a pattern like this to hide private functions of a plugin:</p>

<pre><code>(function ($) {
    var a_private_function = function (opts) {
        opts.onStart();
    }

    $.fn.name_of_plugin = function (options) {
        a_private_function(opts);
    }
})(jQuery);
</code></pre>

<p>jQuery then makes those fn functions available like this:</p>

<pre><code>some_callback = function() {};

jQuery('selector').name_of_plugin( { onStart: some_callback } );
</code></pre>

<p>Now I'd like to override <code>a_private_function</code>. Is there any way I can access it without patching the actual plugin code?</p>

<p>I thought maybe I could access the execution context of the private function by using caller but that did not work:</p>

<pre><code>some_callback = function() {
    console.log(some_callback.caller.a_private_function); // -&gt; undefined
};

jQuery('selector').name_of_plugin( { onStart: some_callback } );
</code></pre>
