Skip to content

Commit

Permalink
Move node normalization into a separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 21, 2010
1 parent 5bb4208 commit c255dcf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 15 additions & 0 deletions engines/node/lib/node-commonjs.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Does normalization of the Node environment to more closely match CommonJS
*/

var sys = require("sys");
// upgrade to ES5 and CommonJS globals
print = sys.puts;
global = this;
require("global");


process.addListener("uncaughtException", function(error){
// obviously we don't want uncaught exceptions to crash the server
print(error.stack);
});
5 changes: 1 addition & 4 deletions node-perstore.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ require.paths.push.apply(require.paths, packagePaths.map(function(path){
return path + "lib"; return path + "lib";
})); }));


var sys = require("sys"); require("node-commonjs");
// upgrade to ES5 and CommonJS globals
global = this;
require("global");

0 comments on commit c255dcf

Please sign in to comment.