mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
src: fix unhandled error in structuredClone
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/54764 Fixes: https://github.com/nodejs/node/issues/54602 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
46c6f8ce26
commit
eab9729d16
@ -567,7 +567,9 @@ Maybe<bool> Message::Serialize(Environment* env,
|
||||
if (host_object &&
|
||||
host_object->GetTransferMode() == TransferMode::kTransferable) {
|
||||
delegate.AddHostObject(host_object);
|
||||
continue;
|
||||
} else {
|
||||
ThrowDataCloneException(context, env->clone_untransferable_str());
|
||||
return Nothing<bool>();
|
||||
}
|
||||
}
|
||||
if (delegate.AddNestedHostObjects().IsNothing())
|
||||
|
@ -26,3 +26,6 @@ assert.strictEqual(structuredClone(undefined, { }), undefined);
|
||||
|
||||
assert.deepStrictEqual(cloned, {});
|
||||
}
|
||||
|
||||
const blob = new Blob();
|
||||
assert.throws(() => structuredClone(blob, { transfer: [blob] }), { name: 'DataCloneError' });
|
||||
|
Loading…
Reference in New Issue
Block a user