### 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/renderer/api/electron_api_ipc_renderer.cc
public content::RenderFrameObserver {
 public:
  static gin::WrapperInfo kWrapperInfo;
  static gin::Handle<IPCRenderer> Create(v8::Isolate* isolate) {
    return gin::CreateHandle(isolate, new IPCRenderer(isolate));
  }
  explicit IPCRenderer(v8::Isolate* isolate)
      : content::RenderFrameObserver(GetCurrentRenderFrame()) {
    RenderFrame* render_frame = GetCurrentRenderFrame();
    DCHECK(render_frame);
    weak_context_ =
        v8::Global<v8::Context>(isolate, isolate->GetCurrentContext());
    weak_context_.SetWeak();
    render_frame->GetBrowserInterfaceBroker()->GetInterface(
        electron_browser_remote_.BindNewPipeAndPassReceiver());
  }
  void OnDestruct() override { electron_browser_remote_.reset(); }
  void WillReleaseScriptContext(v8::Local<v8::Context> context,
                                int32_t world_id) override {
    if (weak_context_.IsEmpty() ||
        weak_context_.Get(context->GetIsolate()) == context)
      electron_browser_remote_.reset();
  }
  
  gin::ObjectTemplateBuilder GetObjectTemplateBuilder(