GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix unhandled error in structuredClone · nodejs/node@97cbcfb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_messaging.cc
  • test/parallel
    • test-structuredClone-global.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_messaging.cc‎

Copy file name to clipboardExpand all lines: src/node_messaging.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,9 @@ Maybe<bool> Message::Serialize(Environment* env,
566566
if (host_object &&
567567
host_object->GetTransferMode() == TransferMode::kTransferable) {
568568
delegate.AddHostObject(host_object);
569-
continue;
569+
} else {
570+
ThrowDataCloneException(context, env->clone_untransferable_str());
571+
return Nothing<bool>();
570572
}
571573
}
572574
if (delegate.AddNestedHostObjects().IsNothing())
Collapse file

‎test/parallel/test-structuredClone-global.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-structuredClone-global.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ assert.strictEqual(structuredClone(undefined, { }), undefined);
2626

2727
assert.deepStrictEqual(cloned, {});
2828
}
29+
30+
const blob = new Blob();
31+
assert.throws(() => structuredClone(blob, { transfer: [blob] }), { name: 'DataCloneError' });

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.