diff --git a/atom/browser/api/atom_api_top_level_window.cc b/atom/browser/api/atom_api_top_level_window.cc index 431f120dc1a21..45e888a2bc25f 100644 --- a/atom/browser/api/atom_api_top_level_window.cc +++ b/atom/browser/api/atom_api_top_level_window.cc @@ -650,9 +650,6 @@ void TopLevelWindow::SetMenu(v8::Isolate* isolate, v8::Local value) { mate::ConvertFromV8(isolate, value, &menu) && !menu.IsEmpty()) { menu_.Reset(isolate, menu.ToV8()); window_->SetMenu(menu->model()); - } else if (value->IsNull()) { - menu_.Reset(); - window_->SetMenu(nullptr); } else { isolate->ThrowException( v8::Exception::TypeError(mate::StringToV8(isolate, "Invalid Menu"))); diff --git a/docs/api/breaking-changes.md b/docs/api/breaking-changes.md index 88f9c08f28513..eebfa6d253682 100644 --- a/docs/api/breaking-changes.md +++ b/docs/api/breaking-changes.md @@ -8,6 +8,15 @@ The `FIXME` string is used in code comments to denote things that should be fixe # Planned Breaking API Changes (6.0) +## `win.setMenu(null)` + +```js +// Deprecated +win.setMenu(null) +// Replace with +win.removeMenu() +``` + ## `electron.screen` in renderer process ```js @@ -59,7 +68,7 @@ Child windows opened with the `nativeWindowOpen` option will always have Node.js # Planned Breaking API Changes (4.0) -The following list includes the breaking API changes planned for Electron 4.0. +The following list includes the breaking API changes made in Electron 4.0. ## `app.makeSingleInstance` diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 4a975c201a525..4ed4e611b9d25 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1308,7 +1308,7 @@ Same as `webContents.reload`. * `menu` Menu | null -Sets the `menu` as the window's menu bar, setting it to `null` will remove the menu bar. +Sets the `menu` as the window's menu bar. #### `win.removeMenu()` _Linux_ _Windows_