mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #11182 from Snuffleupagus/disableWorker-disable-Dict-postMessage
Forbid sending of `Dict`s and `Stream`s, with `postMessage`, when workers are disabled
This commit is contained in:
commit
8c4f4b5eec
1 changed files with 8 additions and 2 deletions
|
@ -1463,8 +1463,14 @@ class LoopbackPort {
|
|||
while (!(desc = Object.getOwnPropertyDescriptor(p, i))) {
|
||||
p = Object.getPrototypeOf(p);
|
||||
}
|
||||
if (typeof desc.value === 'undefined' ||
|
||||
typeof desc.value === 'function') {
|
||||
if (typeof desc.value === 'undefined') {
|
||||
continue;
|
||||
}
|
||||
if (typeof desc.value === 'function') {
|
||||
if (value.hasOwnProperty && value.hasOwnProperty(i)) {
|
||||
throw new Error(
|
||||
`LoopbackPort.postMessage - cannot clone: ${value[i]}`);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
result[i] = cloneValue(desc.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue