if(this.settings.core.worker && window.Blob && window.URL && window.Worker) {
try {
if(this._wrk === null) {
this._wrk = window.URL.createObjectURL(
new window.Blob(
['self.onmessage = ' + func.toString()],
{type:"text/javascript"}
)
);
}
if(!this._data.core.working || force_processing) {
this._data.core.working = true;
w = new window.Worker(this._wrk);
w.onmessage = $.proxy(function (e) {
rslt.call(this, e.data, true);
try { w.terminate(); w = null; } catch(ignore) { }
if(this._data.core.worker_queue.length) {
this._append_json_data.apply(this, this._data.core.worker_queue.shift());
}
else {
this._data.core.working = false;
}
}, this);
if(!args.par) {
if(this._data.core.worker_queue.length) {
this._append_json_data.apply(this, this._data.core.worker_queue.shift());
}
else {
this._data.core.working = false;
}
}
else {
w.postMessage(args);
}
}
else {
this._data.core.worker_queue.push([dom, data, cb, true]);
}
}
catch(e) {
rslt.call(this, func(args), false);
if(this._data.core.worker_queue.length) {
this._append_json_data.apply(this, this._data.core.worker_queue.shift());
}
else {
this._data.core.working = false;
}
}
}
https://zhidao.baidu.com/question/546272587.html