Use // for single line comments

This commit is contained in:
Kevin Sawicki 2016-01-14 10:35:29 -08:00
parent 26350f4ccb
commit f4af744519
43 changed files with 311 additions and 310 deletions

View file

@ -9,15 +9,15 @@ v8Util = process.atomBinding('v8_util');
bindings = process.atomBinding('menu');
/* Automatically generated radio menu item's group id. */
// Automatically generated radio menu item's group id.
nextGroupId = 0;
/* Search between seperators to find a radio menu item and return its group id, */
// Search between seperators to find a radio menu item and return its group id,
/* otherwise generate a group id. */
// otherwise generate a group id.
generateGroupId = function(items, pos) {
var i, item, j, k, ref1, ref2, ref3;
@ -46,7 +46,7 @@ generateGroupId = function(items, pos) {
};
/* Returns the index of item according to |id|. */
// Returns the index of item according to |id|.
indexOfItemById = function(items, id) {
var i, item, j, len;
@ -60,7 +60,7 @@ indexOfItemById = function(items, id) {
};
/* Returns the index of where to insert the item according to |position|. */
// Returns the index of where to insert the item according to |position|.
indexToInsertByPosition = function(items, position) {
var id, insertIndex, query, ref1;
@ -79,7 +79,7 @@ indexToInsertByPosition = function(items, position) {
break;
case 'endof':
/* If the |id| doesn't exist, then create a new group with the |id|. */
// If the |id| doesn't exist, then create a new group with the |id|.
if (insertIndex === -1) {
items.push({
id: id,
@ -88,7 +88,7 @@ indexToInsertByPosition = function(items, position) {
insertIndex = items.length - 1;
}
/* Find the end of the group. */
// Find the end of the group.
insertIndex++;
while (insertIndex < items.length && items[insertIndex].type !== 'separator') {
insertIndex++;
@ -145,7 +145,7 @@ Menu.prototype._init = function() {
menuWillShow: (function(_this) {
return function() {
/* Make sure radio groups have at least one menu item seleted. */
// Make sure radio groups have at least one menu item seleted.
var checked, group, id, j, len, radioItem, ref1, results;
ref1 = _this.groupsMap;
results = [];
@ -175,7 +175,7 @@ Menu.prototype._init = function() {
Menu.prototype.popup = function(window, x, y) {
if ((window != null ? window.constructor : void 0) !== BrowserWindow) {
/* Shift. */
// Shift.
y = x;
x = window;
window = BrowserWindow.getFocusedWindow();
@ -211,14 +211,14 @@ Menu.prototype.insert = function(pos, item) {
break;
case 'radio':
/* Grouping radio menu items. */
// Grouping radio menu items.
item.overrideReadOnlyProperty('groupId', generateGroupId(this.items, pos));
if ((base = this.groupsMap)[name = item.groupId] == null) {
base[name] = [];
}
this.groupsMap[item.groupId].push(item);
/* Setting a radio menu item should flip other items in the group. */
// Setting a radio menu item should flip other items in the group.
v8Util.setHiddenValue(item, 'checked', item.checked);
Object.defineProperty(item, 'checked', {
enumerable: true,
@ -251,16 +251,16 @@ Menu.prototype.insert = function(pos, item) {
this.setRole(pos, item.role);
}
/* Make menu accessable to items. */
// Make menu accessable to items.
item.overrideReadOnlyProperty('menu', this);
/* Remember the items. */
// Remember the items.
this.items.splice(pos, 0, item);
return this.commandsMap[item.commandId] = item;
};
/* Force menuWillShow to be called */
// Force menuWillShow to be called
Menu.prototype._callMenuWillShow = function() {
var item, j, len, ref1, ref2, results;
@ -286,7 +286,7 @@ Menu.setApplicationMenu = function(menu) {
throw new TypeError('Invalid menu');
}
/* Keep a reference. */
// Keep a reference.
applicationMenu = menu;
if (process.platform === 'darwin') {
if (menu === null) {
@ -324,7 +324,7 @@ Menu.buildFromTemplate = function(template) {
insertIndex = indexToInsertByPosition(positionedTemplate, item.position);
} else {
/* If no |position| is specified, insert after last item. */
// If no |position| is specified, insert after last item.
insertIndex++;
}
positionedTemplate.splice(insertIndex, 0, item);