Permalink
Browse files

Move node normalization into a separate module

  • Loading branch information...
kriszyp committed Jan 21, 2010
1 parent 5bb4208 commit c255dcf02490f9b031c88b34e54ff97592fdaf06
Showing with 16 additions and 4 deletions.
  1. +15 −0 engines/node/lib/node-commonjs.js
  2. +1 −4 node-perstore.js
@@ -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);
+});
View
@@ -21,7 +21,4 @@ require.paths.push.apply(require.paths, packagePaths.map(function(path){
return path + "lib";
}));
-var sys = require("sys");
-// upgrade to ES5 and CommonJS globals
-global = this;
-require("global");
+require("node-commonjs");

0 comments on commit c255dcf

Please sign in to comment.