Permalink
Browse files

Properly refer to system module

  • Loading branch information...
kriszyp committed Jun 29, 2010
1 parent 64e88df commit 2a47ea87f20dd63139f2cdda97477dbe36caefb9
Showing with 3 additions and 8 deletions.
  1. +1 −1 lib/observe.js
  2. +2 −7 lib/sys.js
View
@@ -19,7 +19,7 @@ exports.observe = function(object, eventName, listener, before) {
try{
listener.apply(that, args);
}catch(e){
- print(e);
+ require("./sys").print(e);
}
};
if(typeof object.addListener === "function"){
View
@@ -3,18 +3,13 @@ if(typeof console !== "undefined"){
console.log.apply(console, arguments);
}
}
-else{
- try{
- exports.print = require("sys").puts;
- }catch(e){
- exports.print = print;
- }
-}
if(typeof process !== "undefined"){
exports.args = process.argv;
exports.env = process.env;
+ exports.print = require("sys").puts;
}
else{
exports.args = require("system").args;
exports.env = require("system").env;
+ exports.print = print;
}

0 comments on commit 2a47ea8

Please sign in to comment.