<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * v8.0.0-beta.2
* **Operating System:**
  * macOS 10.14.5
* **Last Known Working Electron version:**
  * v6.1.X 

### Expected Behavior
No warnings

### Actual Behavior
The warning

```
[28455:1113/114404.211707:ERROR:CONSOLE(3361)] "Uncaught TypeError: sender.emit is not iterable (cannot read property Symbol(Symbol.iterator))", source: electron/js2c/sandbox_bundle.js (3361)
```

is printed in the console constantly.

### To Reproduce
<!--
Your best chance of getting this bug looked at quickly is to provide an example.
-->

<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->

<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
```sh
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
```
-->

### Screenshots

![image](https://user-images.githubusercontent.com/380914/68798485-5cd39b00-060b-11ea-80d9-1f62cbb97e52.png)


shell/browser/api/atom_api_web_contents.cc
IPC_BEGIN_MESSAGE_MAP(Ws, message)
    IPC_MESSAGE_HANDLER_CODE(WidgetHostMsg_SetCursor, OnCursorChange,
                             handled = false)
    IPC_MESSAGE_UNHANDLED(handled = false)
  IPC_END_MESSAGE_MAP()
  return handled;
}
// There are three ways of destroying a ws:
// 1. call ws.destroy();
// 2. garbage collection;
// 3. user closes the window of ws;
// 4. the embedder detaches the frame.
// For webview only #4 will happen, for BrowserWindow both #1 and #3 may
// happen. The #2 should never happen for ws, because webview is
// managed by GuestViewManager, and BrowserWindow's ws is managed
// by api::BrowserWindow.
// For #1, the destructor will do the cleanup work and we only need to make
// sure "destroyed" event is emitted. For #3, the content::Ws will
// be destroyed on close, and WsDestroyed would be called for it, so
// we need to make sure the api::Ws is also deleted.
// For #4, the Ws will be destroyed by embedder.
void Ws::WsDestroyed() {
  // Cleanup relationships with other parts.
  RemoveFromWeakMap();
  // We can not call Destroy here because we need to call Emit first, but we
  // also do not want any method to be used, so just mark as destroyed here.
  MarkDestroyed();
  Emit("destroyed");
  // For guest view based on OOPIF, the Ws is released by the embedder
  // frame, and we need to clear the reference to the memory.