is not a function

I have this code working fine earlier but instantly it started giving an error is not a function!

Error place ButtonLogic.prototype.onTouchEnd

var ButtonLogic = pc.createScript('buttonLogic');

//initialize code called once per entity
ButtonLogic.prototype.initialize = function() {
    this.button = this.entity.button;
    this.button.on('mouseenter', this.onMouseEnter, this);
    this.button.on('mouseleave', this.onMouseLeave, this);

    this.button.on('touchstart', this.onTouchStart, this);
    this.button.on('touchend', this.onTouchEnd, this);

    this.button.on("destroy", ()=>{'mouseenter', this.onMouseEnter, this);'mouseleave', this.onMouseLeave, this);'touchstart', this.onTouchStart, this);'touchend', this.onTouchEnd, this);
    }, this);

// Having it this simplistic may cause problems if we ever have buttons overlapping each other
ButtonLogic.prototype.onMouseEnter = function(e) {
    Selector.instance.mouseOverButton = true;

ButtonLogic.prototype.onMouseLeave = function(e) {
    Selector.instance.mouseOverButton = false;

ButtonLogic.prototype.onTouchStart = function(e) {
    for (let touch of e.changedTouches) {"addTouchID",;

ButtonLogic.prototype.onTouchEnd = function(e) {
   //  Complex version (no leftovers)
    let eventTouchIDs = =>;
    for (let touchID of Selector.instance.touchIDsOverButtons) {
        if (!eventTouchIDs.includes(touchID))"removeTouchID", touchID);