Remove extra newlines around comments

This commit is contained in:
Kevin Sawicki 2016-01-14 11:10:12 -08:00
parent 990dc30e8d
commit 030d2a843c
40 changed files with 103 additions and 425 deletions

View file

@ -7,9 +7,7 @@ v8Util = process.atomBinding('v8_util');
callbacksRegistry = new CallbacksRegistry;
// Check for circular reference.
isCircular = function(field, visited) {
if (typeof field === 'object') {
if (indexOf.call(visited, field) >= 0) {
@ -20,9 +18,7 @@ isCircular = function(field, visited) {
return false;
};
// Convert the arguments object into an array of meta data.
wrapArgs = function(args, visited) {
var valueToMeta;
if (visited == null) {
@ -90,9 +86,7 @@ wrapArgs = function(args, visited) {
return Array.prototype.slice.call(args).map(valueToMeta);
};
// Convert meta data from browser into real value.
metaToValue = function(meta) {
var RemoteFunction, el, i, j, len, len1, member, ref1, ref2, results, ret;
switch (meta.type) {
@ -121,7 +115,6 @@ metaToValue = function(meta) {
break;
default:
if (meta.type === 'function') {
// A shadow class to represent the remote function object.
ret = RemoteFunction = (function() {
function RemoteFunction() {
@ -163,10 +156,8 @@ metaToValue = function(meta) {
}
}
/*
Track delegate object's life time, and tell the browser to clean up
when the object is GCed.
*/
// Track delegate object's life time, and tell the browser to clean up
// when the object is GCed.
v8Util.setDestructor(ret, function() {
return ipcRenderer.send('ATOM_BROWSER_DEREFERENCE', meta.id);
});
@ -177,9 +168,7 @@ metaToValue = function(meta) {
}
};
// Construct a plain object from the meta.
metaToPlainObject = function(meta) {
var i, len, name, obj, ref1, ref2, value;
obj = (function() {
@ -198,13 +187,9 @@ metaToPlainObject = function(meta) {
return obj;
};
/*
Create a RemoteMemberFunction instance.
This function's content should not be inlined into metaToValue, otherwise V8
may consider it circular reference.
*/
// Create a RemoteMemberFunction instance.
// This function's content should not be inlined into metaToValue, otherwise V8
// may consider it circular reference.
createRemoteMemberFunction = function(metaId, name) {
var RemoteMemberFunction;
return RemoteMemberFunction = (function() {
@ -228,13 +213,9 @@ createRemoteMemberFunction = function(metaId, name) {
})();
};
/*
Create configuration for defineProperty.
This function's content should not be inlined into metaToValue, otherwise V8
may consider it circular reference.
*/
// Create configuration for defineProperty.
// This function's content should not be inlined into metaToValue, otherwise V8
// may consider it circular reference.
createRemoteMemberProperty = function(metaId, name) {
return {
enumerable: true,
@ -253,28 +234,20 @@ createRemoteMemberProperty = function(metaId, name) {
};
};
// Browser calls a callback in renderer.
ipcRenderer.on('ATOM_RENDERER_CALLBACK', function(event, id, args) {
return callbacksRegistry.apply(id, metaToValue(args));
});
// A callback in browser is released.
ipcRenderer.on('ATOM_RENDERER_RELEASE_CALLBACK', function(event, id) {
return callbacksRegistry.remove(id);
});
// List all built-in modules in browser process.
browserModules = require('../../../browser/api/lib/exports/electron');
// And add a helper receiver for each one.
fn = function(name) {
return Object.defineProperty(exports, name, {
get: function() {
@ -287,12 +260,9 @@ for (name in browserModules) {
}
/*
Get remote module.
(Just like node's require, the modules are cached permanently, note that this
is safe leak since the object is not expected to get freed in browser)
*/
// Get remote module.
// (Just like node's require, the modules are cached permanently, note that this
// is safe leak since the object is not expected to get freed in browser)
moduleCache = {};
exports.require = function(module) {
@ -306,12 +276,10 @@ exports.require = function(module) {
// Optimize require('electron').
moduleCache.electron = exports;
// Alias to remote.require('electron').xxx.
builtinCache = {};
exports.getBuiltin = function(module) {
@ -323,9 +291,7 @@ exports.getBuiltin = function(module) {
return builtinCache[module] = metaToValue(meta);
};
// Get current BrowserWindow object.
windowCache = null;
exports.getCurrentWindow = function() {
@ -337,9 +303,7 @@ exports.getCurrentWindow = function() {
return windowCache = metaToValue(meta);
};
// Get current WebContents object.
webContentsCache = null;
exports.getCurrentWebContents = function() {
@ -351,18 +315,14 @@ exports.getCurrentWebContents = function() {
return webContentsCache = metaToValue(meta);
};
// Get a global object in browser.
exports.getGlobal = function(name) {
var meta;
meta = ipcRenderer.sendSync('ATOM_BROWSER_GLOBAL', name);
return metaToValue(meta);
};
// Get the process object in browser.
processCache = null;
exports.__defineGetter__('process', function() {
@ -372,9 +332,7 @@ exports.__defineGetter__('process', function() {
return processCache;
});
// Create a funtion that will return the specifed value when called in browser.
exports.createFunctionWithReturnValue = function(returnValue) {
var func;
func = function() {
@ -384,9 +342,7 @@ exports.createFunctionWithReturnValue = function(returnValue) {
return func;
};
// Get the guest WebContents from guestInstanceId.
exports.getGuestWebContents = function(guestInstanceId) {
var meta;
meta = ipcRenderer.sendSync('ATOM_BROWSER_GUEST_WEB_CONTENTS', guestInstanceId);