Added fallback to fake worker if serialization of typed array fails.
This happens e.g. in Opera 11.60.
This commit is contained in:
parent
f10a543080
commit
fdcc4ca590
@ -605,7 +605,13 @@ var PDFDoc = (function PDFDocClosure() {
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
var testObj = new Uint8Array(1);
|
var testObj = new Uint8Array(1);
|
||||||
messageHandler.send('test', testObj);
|
// Some versions of Opera throw a DATA_CLONE_ERR on serializing the typed array.
|
||||||
|
// If such an error occurs, we fallback to a faked worker.
|
||||||
|
try {
|
||||||
|
messageHandler.send('test', testObj);
|
||||||
|
} catch (e) {
|
||||||
|
this.setupFakeWorker();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setupFakeWorker();
|
this.setupFakeWorker();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user