Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Dec 22, 2009
1 parent f91e347 commit 64fe9fb
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,54 +97,54 @@ process.assert = function (x, msg) {
// Dual licensed under the MIT and GPL licenses.
// http://docs.jquery.com/License
process.mixin = function() {
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;

// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}

// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !(typeof target === 'function') )
target = {};

// mixin process itself if only one argument is passed
if ( length == i ) {
target = GLOBAL;
--i;
}

for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( var name in options ) {
var src = target[ name ], copy = options[ name ];

// Prevent never-ending loop
if ( target === copy )
continue;

// Recurse if we're merging object values
if ( deep && copy && typeof copy === "object" ) {
target[ name ] = process.mixin( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );

// Don't bring in undefined values
} else {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;

// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}

// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !(typeof target === 'function') )
target = {};

// mixin process itself if only one argument is passed
if ( length == i ) {
target = GLOBAL;
--i;
}

for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( var name in options ) {
var src = target[ name ], copy = options[ name ];

// Prevent never-ending loop
if ( target === copy )
continue;

// Recurse if we're merging object values
if ( deep && copy && typeof copy === "object" ) {
target[ name ] = process.mixin( deep,
// Never move original objects, clone them
src || ( copy.length != null ? [ ] : { } )
, copy );

// Don't bring in undefined values
} else {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};


Expand Down Expand Up @@ -369,7 +369,7 @@ process.watchFile = function (filename) {
options = {};
listener = arguments[1];
}

if (options.persistent === undefined) options.persistent = true;
if (options.interval === undefined) options.interval = 0;

Expand Down Expand Up @@ -718,7 +718,7 @@ var path = pathModule.exports;

process.paths = [ path.join(process.installPrefix, "lib/node/libraries")
];

if (process.ENV["HOME"]) {
process.paths.unshift(path.join(process.ENV["HOME"], ".node_libraries"));
}
Expand All @@ -744,7 +744,7 @@ function findModulePath (id, dirs, callback) {
callback();
return;
}

var dir = dirs[0];
var rest = dirs.slice(1, dirs.length);

Expand Down Expand Up @@ -840,7 +840,7 @@ Module.prototype.load = function (filename, loadPromise) {
Module.prototype.loadObject = function (filename, loadPromise) {
var self = this;
// XXX Not yet supporting loading from HTTP. would need to download the
// file, store it to tmp then run dlopen on it.
// file, store it to tmp then run dlopen on it.
setTimeout(function () {
self.loaded = true;
process.dlopen(filename, self.exports); // FIXME synchronus
Expand All @@ -850,7 +850,7 @@ Module.prototype.loadObject = function (filename, loadPromise) {

function cat (id, loadPromise) {
var promise;

debug(id);

if (id.match(/^http:\/\//)) {
Expand Down Expand Up @@ -899,8 +899,8 @@ Module.prototype.loadScript = function (filename, loadPromise) {
require.async = requireAsync;
require.main = process.mainModule;
// create wrapper function
var wrapper = "var __wrap__ = function (exports, require, module, __filename) { "
+ content
var wrapper = "var __wrap__ = function (exports, require, module, __filename) { "
+ content
+ "\n}; __wrap__;";
var compiledWrapper = process.compile(wrapper, filename);

Expand Down

0 comments on commit 64fe9fb

Please sign in to comment.