sanitize MenuItem options
This commit is contained in:
		
					parent
					
						
							
								fdf3f6ce30
							
						
					
				
			
			
				commit
				
					
						b7e078e98d
					
				
			
		
					 2 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,11 @@ let nextCommandId = 0
 | 
			
		|||
const MenuItem = function (options) {
 | 
			
		||||
  const {Menu} = require('electron')
 | 
			
		||||
 | 
			
		||||
  // Clone and sanitize the provided options
 | 
			
		||||
  options = Object.assign({}, options)
 | 
			
		||||
  delete options.overrideProperty
 | 
			
		||||
  delete options.overrideReadOnlyProperty
 | 
			
		||||
 | 
			
		||||
  Object.assign(this, options)
 | 
			
		||||
 | 
			
		||||
  if (this.submenu != null && this.submenu.constructor !== Menu) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue