mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: make menu.popup options optional (#13977)
* add empty object as default param for options * update docs * add spec for optional options * fix: add null check for options
This commit is contained in:
@@ -47,7 +47,7 @@ Menu.prototype._init = function () {
|
||||
this.delegate = delegate
|
||||
}
|
||||
|
||||
Menu.prototype.popup = function (options) {
|
||||
Menu.prototype.popup = function (options = {}) {
|
||||
if (options == null || typeof options !== 'object') {
|
||||
throw new TypeError('Options must be an object')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user