Skip to content

Commit

Permalink
fix: Prevent serializer from calling path on Event object. (#269)
Browse files Browse the repository at this point in the history
Fixes #233
  • Loading branch information
nicksrandall committed Oct 3, 2022
1 parent 36fb985 commit 7690c31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/sandbox/main-serialization.ts
Expand Up @@ -97,7 +97,11 @@ const serializeObjectForWorker = (
added.add(obj);
for (propName in obj) {
if (isValidMemberName(propName)) {
propValue = obj[propName];
if (propName === 'path' && obj instanceof Event) {
propValue = obj.composedPath();
} else {
propValue = obj[propName];
}
if (includeFunctions || typeof propValue !== 'function') {
if (includeEmptyStrings || propValue !== '') {
serializedObj[propName] = serializeForWorker(winId, propValue, added);
Expand Down

1 comment on commit 7690c31

@vercel
Copy link

@vercel vercel bot commented on 7690c31 Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.