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

@ -19,12 +19,12 @@ Module = require('module');
process.argv.splice(1, 1);
/* Clear search paths. */
// Clear search paths.
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths'));
/* Import common settings. */
// Import common settings.
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init'));
@ -35,12 +35,12 @@ if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
}
/* Expose public APIs. */
// Expose public APIs.
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports'));
/* The global variable will be used by ipc for event dispatching */
// The global variable will be used by ipc for event dispatching
v8Util = process.atomBinding('v8_util');
@ -54,7 +54,7 @@ electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (event, m
electron.webFrame[method].apply(electron.webFrame, args);
});
/* Process command line arguments. */
// Process command line arguments.
nodeIntegration = 'false';
@ -63,11 +63,11 @@ for (i = 0, len = ref.length; i < len; i++) {
arg = ref[i];
if (arg.indexOf('--guest-instance-id=') === 0) {
/* This is a guest web view. */
// This is a guest web view.
process.guestInstanceId = parseInt(arg.substr(arg.indexOf('=') + 1));
} else if (arg.indexOf('--opener-id=') === 0) {
/* This is a guest BrowserWindow. */
// This is a guest BrowserWindow.
process.openerId = parseInt(arg.substr(arg.indexOf('=') + 1));
} else if (arg.indexOf('--node-integration=') === 0) {
nodeIntegration = arg.substr(arg.indexOf('=') + 1);
@ -78,20 +78,20 @@ for (i = 0, len = ref.length; i < len; i++) {
if (location.protocol === 'chrome-devtools:') {
/* Override some inspector APIs. */
// Override some inspector APIs.
require('./inspector');
nodeIntegration = 'true';
} else if (location.protocol === 'chrome-extension:') {
/* Add implementations of chrome API. */
// Add implementations of chrome API.
require('./chrome-api');
nodeIntegration = 'true';
} else {
/* Override default web functions. */
// Override default web functions.
require('./override');
/* Load webview tag implementation. */
// Load webview tag implementation.
if (process.guestInstanceId == null) {
require('./web-view/web-view');
require('./web-view/web-view-attributes');
@ -100,27 +100,27 @@ if (location.protocol === 'chrome-devtools:') {
if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration === 'except-iframe' || nodeIntegration === 'manual-enable-iframe') {
/* Export node bindings to global. */
// Export node bindings to global.
global.require = require;
global.module = module;
/* Set the __filename to the path of html file if it is file: protocol. */
// Set the __filename to the path of html file if it is file: protocol.
if (window.location.protocol === 'file:') {
pathname = process.platform === 'win32' && window.location.pathname[0] === '/' ? window.location.pathname.substr(1) : window.location.pathname;
global.__filename = path.normalize(decodeURIComponent(pathname));
global.__dirname = path.dirname(global.__filename);
/* Set module's filename so relative require can work as expected. */
// Set module's filename so relative require can work as expected.
module.filename = global.__filename;
/* Also search for module under the html file. */
// Also search for module under the html file.
module.paths = module.paths.concat(Module._nodeModulePaths(global.__dirname));
} else {
global.__filename = __filename;
global.__dirname = __dirname;
}
/* Redirect window.onerror to uncaughtException. */
// Redirect window.onerror to uncaughtException.
window.onerror = function(message, filename, lineno, colno, error) {
if (global.process.listeners('uncaughtException').length > 0) {
global.process.emit('uncaughtException', error);
@ -130,13 +130,13 @@ if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration =
}
};
/* Emit the 'exit' event when page is unloading. */
// Emit the 'exit' event when page is unloading.
window.addEventListener('unload', function() {
return process.emit('exit');
});
} else {
/* Delete Node's symbols after the Environment has been loaded. */
// Delete Node's symbols after the Environment has been loaded.
process.once('loaded', function() {
delete global.process;
delete global.setImmediate;
@ -146,7 +146,7 @@ if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration =
}
/* Load the script specfied by the "preload" attribute. */
// Load the script specfied by the "preload" attribute.
if (preloadScript) {
try {