hive/html/jquery/3rd/PapaParse-4.0.7/papaparse.js
// Callback when main thread receives a message
Callback when main thread receives a message
Callback when main thread receives a message
function mainThreadReceivedMessage(e)
    {
        var msg = e.data;
        var worker = workers[msg.workerId];
        if (msg.error)
            worker.userError(msg.error, msg.file);
        else if (msg.results && msg.results.data)
        {
            if (isFunction(worker.userStep))
            {
                for (var i = 0; i < msg.results.data.length; i++)
                {
                    worker.userStep({
                        data: [msg.results.data[i]],
                        errors: msg.results.errors,
                        meta: msg.results.meta
                    });
                }
                delete msg.results;    
            }
            else if (isFunction(worker.userChunk))
            {
                worker.userChunk(msg.results, msg.file);
                delete msg.results;
            }
        }
        if (msg.finished)
        {
            if (isFunction(workers[msg.workerId].userComplete))
                workers[msg.workerId].userComplete(msg.results);
            workers[msg.workerId].terminate();
            delete workers[msg.workerId];
        }
    }
function mainThreadReceivedMessage ( e ) { var msg = e . data ; var worker = workers [ msg . workerId ] ; if ( msg . error ) worker . userError ( msg . error , msg . file ) ; else if ( msg . results && msg . results . data ) { if ( isFunction ( worker . userStep ) ) { for ( var i = 0 ; i < msg . results . data . length ; i ++ ) { worker . userStep ( { data : [ msg . results . data [ i ] ] , errors : msg . results . errors , meta : msg . results . meta } ) ; } delete msg . results ; } else if ( isFunction ( worker . userChunk ) ) { worker . userChunk ( msg . results , msg . file ) ; delete msg . results ; } } if ( msg . finished ) { if ( isFunction ( workers [ msg . workerId ] . userComplete ) ) workers [ msg . workerId ] . userComplete ( msg . results ) ; workers [ msg . workerId ] . terminate ( ) ; delete workers [ msg . workerId ] ; } }
Callback when main thread receives a message
Callback when main thread receives a message
// free memory ASAP