Skip to content

Commit

Permalink
Merge pull request #11182 from Snuffleupagus/disableWorker-disable-Di…
Browse files Browse the repository at this point in the history
…ct-postMessage

Forbid sending of `Dict`s and `Stream`s, with `postMessage`, when workers are disabled
  • Loading branch information
timvandermeij authored Sep 29, 2019
2 parents 06e4eb4 + 3f8fee3 commit 8c4f4b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8c4f4b5

Please sign in to comment.