Language: JavaScript
Label: vulnerable
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
Menus.prototype.addMenuItem=function(a,c,f,e,g,d){var k=this.editorUi.actions.get(c);return null!=k&&(a.showDisabled||k.isEnabled())&&k.visible?(c=a.addItem(d||k.label,null,function(n){k.funct(e,n)},f,g,k.isEnabled()),k.toggleAction&&k.isSelected()&&a.addCheckmark(c,Editor.checkmarkImage),this.addShortcut(c,k),c):null};