title: What's the purpose for the variable `tmp` in this snippet?
body: <p>I'm having troubling understanding the point of the variable <code>tmp</code> in the following code:</p>
  
  <pre><code>$.extend($.Widget.prototype, {
      yield: null,
      returnValues: { },
      before: function(method, f) {
          var original = this[method];
          this[method] = function() {
              f.apply(this, arguments);
              return original.apply(this, arguments);
          };
      },
      after: function(method, f) {
          var original = this[method];
          this[method] = function() {
              this.returnValues[method] = original.apply(this, arguments);
              return f.apply(this, arguments);
          }
      },
      around: function(method, f) {
          var original = this[method];
          this[method] = function() {
              var tmp = this.yield;
              this.yield = original;
              var ret = f.apply(this, arguments);
              this.yield = tmp;
              return ret;
          }
      }
  });
  </code></pre>
  
  <p>Why not simply using a function-local variable <code>var yield</code> and completely leaving out <code>tmp</code> in <code>around</code> method? What purpose does it serve? Is this a common design pattern?</p>
  
  <p>Thanks for some hint.</p>