### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

16.0.6

### What operating system are you using?

Windows

### Operating System Version

Win 10 Pro

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

```ipcRenderer.postMessage("test",{});``` should successfully post.

### Actual Behavior

`ipcRenderer.postMessage("test",{});` fails with error `TypeError: Invalid value for transfer`.

`ipcRenderer.postMessage("test",{},[]);` succeeds.

The transfer parameter is optional according to the [api docs](https://www.electronjs.org/docs/latest/api/ipc-renderer#ipcrendererpostmessagechannel-message-transfer). I would assume the docs are correct as this approximately matches the standard web postMessage.

### Testcase Gist URL

https://gist.github.com/Stinger-au/8394108f5f6754dad03dbbcfef84e3fe

### Additional Information

_No response_
shell/browser/api/electron_api_web_frame_main.cc
return "WebFrameMain";
}
}  
}  
namespace {
using electron::api::WebFrameMain;
v8::Local<v8::Value> FromID(gin_helper::ErrorThrower thrower,
                            int render_process_id,
                            int render_frame_id) {
  if (!electron::Browser::Get()->is_ready()) {
    thrower.ThrowError("WebFrameMain is available only after app ready");
    return v8::Null(thrower.isolate());
  }
  auto* rfh =
      content::RenderFrameHost::FromID(render_process_id, render_frame_id);
  return WebFrameMain::From(thrower.isolate(), rfh).ToV8();
}
void Initialize(v8::Local<v8::Object> exports,
                v8::Local<v8::Value> unused,
                v8::Local<v8::Context> context,
                void* priv) {
  v8::Isolate* isolate = context->GetIsolate();
  gin_helper::Dictionary dict(isolate, exports);
  dict.Set("WebFrameMain", WebFrameMain::GetConstructor(context));
  dict.SetMethod("fromId", &FromID);
}
}  
NODE_LINKED_MODULE_CONTEXT_AWARE(electron_browser_web_frame_main, Initialize)