if process.platform is 'darwin'
throw new Error('BrowserWindow.setMenu is not available on OS X')
- throw new TypeError('Invalid menu') unless menu?.constructor?.name is 'Menu'
+ throw new TypeError('Invalid menu') unless menu is null or menu?.constructor?.name is 'Menu'
@menu = menu # Keep a reference of menu in case of GC.
@menu.attachToWindow this
applicationMenu = null
Menu.setApplicationMenu = (menu) ->
- throw new TypeError('Invalid menu') unless menu?.constructor is Menu
+ throw new TypeError('Invalid menu') unless menu is null or menu.constructor is Menu
applicationMenu = menu # Keep a reference.
if process.platform is 'darwin'
menu._callMenuWillShow()
+ throw new Error('You can not remove application menu') if menu is null
bindings.setApplicationMenu menu
else
windows = BrowserWindow.getAllWindows()