mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Check menu.popup options are an object (#12325)
* check menu.popup options are an object * Add a spec for menu.popup options check * remove stray .only
This commit is contained in:
@@ -47,6 +47,9 @@ Menu.prototype._init = function () {
|
||||
}
|
||||
|
||||
Menu.prototype.popup = function (options) {
|
||||
if (options == null || typeof options !== 'object') {
|
||||
throw new TypeError('Options must be an object')
|
||||
}
|
||||
let {window, x, y, positioningItem, callback} = options
|
||||
|
||||
// no callback passed
|
||||
|
||||
Reference in New Issue
Block a user