B2G/gecko/browser/devtools/debugger/debugger-view.js
/**
     * Creates a menu item specified by a name with the appropriate attributes
     * (label and command handler).
     *
     * @param string aName
     *        A global identifier for the menu item.
     * @param boolean aHiddenFlag
     *        True if this menuitem should be hidden.
     */
Creates a menu item specified by a name with the appropriate attributes
(label and command handler).

@param string aName
A global identifier for the menu item.
@param boolean aHiddenFlag
True if this menuitem should be hidden.
Creates a menu item specified by a name with the appropriate attributes ( label and command handler ) . @param string aName A global identifier for the menu item . @param boolean aHiddenFlag True if this menuitem should be hidden .
function createMenuItem(aName, aHiddenFlag) {
      let menuitem = document.createElement("menuitem");
      let command = document.createElement("command");
      let func = this["_on" + aName.charAt(0).toUpperCase() + aName.slice(1)];
      let label = L10N.getStr("breakpointMenuItem." + aName);
      let prefix = "bp-cMenu-";
      let commandId = prefix + aName + "-" + aBreakpoint.id + "-command";
      let menuitemId = prefix + aName + "-" + aBreakpoint.id + "-menuitem";
      command.setAttribute("id", commandId);
      command.setAttribute("label", label);
      command.addEventListener("command", func.bind(this, aBreakpoint), true);
      menuitem.setAttribute("id", menuitemId);
      menuitem.setAttribute("command", commandId);
      menuitem.setAttribute("hidden", aHiddenFlag);
      commandset.appendChild(command);
      menupopup.appendChild(menuitem);
      aBreakpoint[aName] = {
        menuitem: menuitem,
        command: command
      };
    }
function createMenuItem ( aName , aHiddenFlag ) { let menuitem = document . createElement ( "menuitem" ) ; let command = document . createElement ( "command" ) ; let func = this [ "_on" + aName . charAt ( 0 ) . toUpperCase ( ) + aName . slice ( 1 ) ] ; let label = L10N . getStr ( "breakpointMenuItem." + aName ) ; let prefix = "bp-cMenu-" ; let commandId = prefix + aName + "-" + aBreakpoint . id + "-command" ; let menuitemId = prefix + aName + "-" + aBreakpoint . id + "-menuitem" ; command . setAttribute ( "id" , commandId ) ; command . setAttribute ( "label" , label ) ; command . addEventListener ( "command" , func . bind ( this , aBreakpoint ) , true ) ; menuitem . setAttribute ( "id" , menuitemId ) ; menuitem . setAttribute ( "command" , commandId ) ; menuitem . setAttribute ( "hidden" , aHiddenFlag ) ; commandset . appendChild ( command ) ; menupopup . appendChild ( menuitem ) ; aBreakpoint [ aName ] = { menuitem : menuitem , command : command } ; }
Creates a menu item specified by a name with the appropriate attributes
 (label and command handler).
Creates a menu item specified by a name with the appropriate attributes ( label and command handler ) .