Permalink
Browse files

Use util instead of sys in examples.

Make sure the example Jerk script continues to work in future node.js
releases. The node.js sys library has been a pointer to util since
0.3 and has now been removed completely in the node.js development
branch.
  • Loading branch information...
1 parent ff9a74c commit 9194284856f7566d304e8687ac422ad2ccd2e385 @michaeltwofish committed Apr 4, 2012
Showing with 11 additions and 11 deletions.
  1. +7 −7 examples/example.js
  2. +4 −4 examples/switch-bench.js
View
@@ -1,16 +1,16 @@
var fs = require("fs"),
- sys = require("sys"),
+ util = require("util"),
path = require("path"),
xml = fs.cat(path.join(__dirname, "test.xml")),
sax = require("../lib/sax"),
strict = sax.parser(true),
loose = sax.parser(false, {trim:true}),
inspector = function (ev) { return function (data) {
- // sys.error("");
- // sys.error(ev+": "+sys.inspect(data));
- // for (var i in data) sys.error(i+ " "+sys.inspect(data[i]));
- // sys.error(this.line+":"+this.column);
+ // util.error("");
+ // util.error(ev+": "+util.inspect(data));
+ // for (var i in data) util.error(i+ " "+util.inspect(data[i]));
+ // util.error(this.line+":"+this.column);
}};
xml.addCallback(function (xml) {
@@ -20,8 +20,8 @@ xml.addCallback(function (xml) {
loose["on"+ev] = inspector(ev);
});
loose.onend = function () {
- // sys.error("end");
- // sys.error(sys.inspect(loose));
+ // util.error("end");
+ // util.error(util.inspect(loose));
};
// do this one char at a time to verify that it works.
@@ -10,7 +10,7 @@ var xml = require("posix").cat("test.xml").wait(),
parser = sax.parser(false, {trim:true}),
parserT = saxT.parser(false, {trim:true}),
- sys = require("sys");
+ util = require("util");
var count = exports.stepsPerLap = 500,
@@ -19,7 +19,7 @@ var count = exports.stepsPerLap = 500,
exports.countPerLap = 1000;
exports.compare = {
"switch" : function () {
- // sys.debug("switch runs: "+runs++);
+ // util.debug("switch runs: "+runs++);
// for (var x = 0; x < l; x += 1000) {
// parser.write(xml.substr(x, 1000))
// }
@@ -30,7 +30,7 @@ exports.compare = {
// done();
},
trampoline : function () {
- // sys.debug("trampoline runs: "+runs++);
+ // util.debug("trampoline runs: "+runs++);
// for (var x = 0; x < l; x += 1000) {
// parserT.write(xml.substr(x, 1000))
// }
@@ -42,4 +42,4 @@ exports.compare = {
},
};
-sys.debug("rock and roll...");
+util.debug("rock and roll...");

0 comments on commit 9194284

Please sign in to comment.