title: Class method is not a function?
body: <p>I'm getting "Uncaught TypeError: this.time_to_x is not a function" when incorporating some open source ES5 code into my ES6 Class.  Here is the class (I've removed some of the bulk, but most of the essential stuff is there).  Assume Diamond() is called.  It's this line that gets the error: x = this.time_to_x(frame.time);</p>
  
  <p>Why is time_to_x() not being considered a function?</p>
  
  <pre><code>export default class TimelinePanel {
  
    constructor(ctx) {
      this.ctx = ctx;
      this.ctx_wrap = ctx; 
    }
  
    create (ctx) {
      this.rect({ctx, x: 20, y: 15, width: 130, height: 10}); // ***
      this.drawLayerContents();
    }
  
    Diamond(frame, y) {
  
      var x, y2;
  
      x = this.time_to_x(frame.time);
      y2 = y + LINE_HEIGHT * 0.5  - DIAMOND_SIZE / 2;
  
      var self = this;
      var isOver = false;
  
      this.path = function() {
          this.ctx_wrap
              .beginPath()
              .moveTo(x, y2)
              .lineTo(x + DIAMOND_SIZE / 2, y2 + DIAMOND_SIZE / 2)
              .lineTo(x, y2 + DIAMOND_SIZE)
              .lineTo(x - DIAMOND_SIZE / 2, y2 + DIAMOND_SIZE / 2)
              .closePath();
      };
    }
  
    drawLayerContents() {
      // ...
      for (i = 0; i &lt; il; i++) {
          // ...
          for (j = 0; j &lt; values.length; j++) {
              // Dimonds
              frame = values[j];
              renderItems.push(new this.Diamond(frame, y));
          }
      }
    }
  
    y_to_track(y) {
      if (y - MARKER_TRACK_HEIGHT &lt; 0) return -1;
      return (y - MARKER_TRACK_HEIGHT + scrollTop) / LINE_HEIGHT | 0;
    }
  
    x_to_time(x) {
      var units = time_scale / tickMark3;
      return frame_start + ((x - LEFT_GUTTER) / units | 0) / tickMark3;
    }
  
    time_to_x(s) {
      var ds = s - frame_start;
      ds *= time_scale;
      ds += LEFT_GUTTER;
      return ds;
    }
  }
  </code></pre>