.push is not a function

Hi,
I develop a custom report plugin for Jira. I’m using the following javascript function:

// data is an array of objects, like: [{values: [], time: {}}]
function buildTableData(data){
    var tableData = [];
    for(var i=0; i<data.length; i++){
        var values = data[i].values; 
        var time = data[i].time;
        if(time.start && time.end){
            var tableTime = (calculateDays(time.start, time.end)).toFixed(2);
            var tableStart = (new Date(time.start)).toISOString().split('.')[0]+"Z";
            var tableEnd = (new Date(time.end)).toISOString().split('.')[0]+"Z";
            var tableRow = values.concat([tableStart, tableEnd, tableTime]);
            tableData.push(tableRow);
        }
    }
    return tableData;
}

Sometimes firefox returns an error:

TypeError: tableData.push is not a function

Since this error does not always show up, when processing exactly the same data, I don’t think it’s a pure javascript issue.

EDIT: As soon as this error appears for the first time, running the report with whatever configuration leads to the described error.

Any suggestion is appreciated.
Thanks in advance.

A closer look showed that parts of an older version of the plugin got cached, where tableData was not an array…