Make commandId a read only property
authorKevin Sawicki <kevinsawicki@gmail.com>
Wed, 22 Jun 2016 17:07:02 +0000 (10:07 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 22 Jun 2016 17:07:02 +0000 (10:07 -0700)
lib/browser/api/menu-item.js

index e1ccda4..264be81 100644 (file)
@@ -72,7 +72,7 @@ const MenuItem = function (options) {
     throw new Error(`Unknown menu item type: ${this.type}`)
   }
 
-  this.commandId = ++nextCommandId
+  this.overrideReadOnlyProperty('commandId', ++nextCommandId)
 
   const click = options.click
   this.click = (event, focusedWindow) => {