JavaScript - Get calling object
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/280389/javascript-how-do-you-find-the-caller-function">Javascript how do you find the caller function?</a>  </p>
</blockquote>



<p>Hi guys!</p>

<p>Is there a way to get the value of <code>this</code> from the function which has called the current function?
Look at this:</p>

<pre><code>function TraceMySelf(){
    console.log(this);
}
function A(){
    TraceMySelf();
    console.log(this);
}

var a = new A();
</code></pre>

<p>When this code is executed, the console displays first the <code>window</code> object and then the <code>a</code> object. How can I make the code display the <code>a</code> object twice, with only changing line 2? I know that I could apply the function inside <code>A</code> with <code>this</code>, but that isn't what I want.</p>

<p>Is this possible?</p>

<p>Thanks for your help!</p>
