Adjust the values sent, with the 'test' message, by the WorkerMessageHandler.setup
method
Note how the sent values have inconsistent types, with a boolean in one case and an object in the other (normal) case. Furthermore, explicitly sending a `supportTypedArray: true` property seems superfluous at least to me.
This commit is contained in:
parent
7212ff4eea
commit
f0534b9b51
@ -67,17 +67,14 @@ var WorkerMessageHandler = {
|
|||||||
|
|
||||||
// check if Uint8Array can be sent to worker
|
// check if Uint8Array can be sent to worker
|
||||||
if (!(data instanceof Uint8Array)) {
|
if (!(data instanceof Uint8Array)) {
|
||||||
handler.send('test', false);
|
handler.send('test', null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// making sure postMessage transfers are working
|
// making sure postMessage transfers are working
|
||||||
var supportTransfers = data[0] === 255;
|
const supportTransfers = data[0] === 255;
|
||||||
handler.postMessageTransfers = supportTransfers;
|
handler.postMessageTransfers = supportTransfers;
|
||||||
|
|
||||||
handler.send('test', {
|
handler.send('test', { supportTransfers, });
|
||||||
supportTypedArray: true,
|
|
||||||
supportTransfers,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
handler.on('configure', function wphConfigure(data) {
|
handler.on('configure', function wphConfigure(data) {
|
||||||
|
@ -1665,7 +1665,7 @@ const PDFWorker = (function PDFWorkerClosure() {
|
|||||||
terminateEarly();
|
terminateEarly();
|
||||||
return; // worker was destroyed
|
return; // worker was destroyed
|
||||||
}
|
}
|
||||||
if (data && data.supportTypedArray) {
|
if (data) { // supportTypedArray
|
||||||
this._messageHandler = messageHandler;
|
this._messageHandler = messageHandler;
|
||||||
this._port = worker;
|
this._port = worker;
|
||||||
this._webWorker = worker;
|
this._webWorker = worker;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user