old_contents: /* 
   * Copyright 2013 The Polymer Authors. All rights reserved.
   * Use of this source code is governed by a BSD-style
   * license that can be found in the LICENSE file.
   */
  
  (function(scope) {
    
    // usage
    
    // invoke cb.call(this) in 100ms, unless the job is re-registered,
    // which resets the timer
    // 
    // this.myJob = this.job(this.myJob, cb, 100)
    //
    // returns a job handle which can be used to re-register a job
  
    var Job = function(inContext) {
      this.context = inContext;
    };
    Job.prototype = {
      go: function(callback, wait) {
        this.callback = callback;
        this.handle = setTimeout(this.complete.bind(this), wait);
      },
      stop: function() {
        if (this.handle) {
          clearTimeout(this.handle);
          this.handle = null;
        }
      },
      complete: function() {
        if (this.handle) {
          this.stop();
          this.callback.call(this.context);
        }
      }
    };
    
    function job(job, callback, wait) {
      if (job) {
        job.stop();
      } else {
        job = new Job(this);
      }
      job.go(callback, wait);
      return job;
    }
    
    // exports 
  
    scope.job = job;
    
  })(Polymer);
  
new_contents: /* 
   * Copyright 2013 The Polymer Authors. All rights reserved.
   * Use of this source code is governed by a BSD-style
   * license that can be found in the LICENSE file.
   */
  
  (function(scope) {
    
    // usage
    
    // invoke cb.call(this) in 100ms, unless the job is re-registered,
    // which resets the timer
    // 
    // this.myJob = this.job(this.myJob, cb, 100)
    //
    // returns a job handle which can be used to re-register a job
  
    var Job = function(inContext) {
      this.context = inContext;
      this.boundComplete = this.complete.bind(this)
    };
    Job.prototype = {
      go: function(callback, wait) {
        this.callback = callback;
        var h;
        if (!wait) {
          h = requestAnimationFrame(this.boundComplete);
          this.handle = function() {
            cancelAnimationFrame(h);
          }
        } else {
          h = setTimeout(this.boundComplete, wait);
          this.handle = function() {
            clearTimeout(h);
          }
        }
      },
      stop: function() {
        if (this.handle) {
          this.handle();
          this.handle = null;
        }
      },
      complete: function() {
        if (this.handle) {
          this.stop();
          this.callback.call(this.context);
        }
      }
    };
    
    function job(job, callback, wait) {
      if (job) {
        job.stop();
      } else {
        job = new Job(this);
      }
      job.go(callback, wait);
      return job;
    }
    
    // exports 
  
    scope.job = job;
    
  })(Polymer);
  
subject: allow job with no timeout to go at requestAnimationFrame time.