code: function () {
        this.clear();
        if (this.interactive) {
          removeListener(this.upperCanvasEl, 'mousedown', this._onMouseDown);
          removeListener(this.upperCanvasEl, 'mousemove', this._onMouseMove);
          removeListener(fabric.window, 'resize', this._onResize);
        }
        return this;
      }
docs: Clears a canvas element and removes all event handlers.
  @method dispose
  @return {fabric.Canvas} thisArg
  @chainable