Added fallback to fake worker if serialization of typed array fails.

This happens e.g. in Opera 11.60.
This commit is contained in:
Steffen Märcker 2011-12-28 09:10:06 +01:00
parent f10a543080
commit fdcc4ca590

View File

@ -605,7 +605,13 @@ var PDFDoc = (function PDFDocClosure() {
}.bind(this));
var testObj = new Uint8Array(1);
// 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 {
this.setupFakeWorker();
}