Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Hi! I fixed some calls to "sys" for you! #2

Open
wants to merge 1 commit into from

2 participants

node-migrator-bot Farrin Reid
node-migrator-bot

Hello badlee!

I am migrationBot, an open-source bot, and I'm here to help you migrate your codebase to node v0.8!

Did you know that the "sys" module throws an error if your program tries to require it in node v0.8? To help keep your code running, I automatically replaced var sys = require('sys') with var util = require('util').

If you'd like to know more about these changes in node.js, take a look at joyent/node@1582cf#L1R51 and https://github.com/joyent/node/blob/1582cfebd6719b2d2373547994b3dca5c8c569c0/ChangeLog#L51 and http://blog.jit.su/introducing-blakmatrix-and-migratorbot .

As for myself, I was written by your friendly neighborhood node ninjas at Nodejitsu, and you can find them at #nodejitsu on irc.freenode.net or with http://webchat.jit.su .

Enjoy!

--migrationBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 23, 2012
  1. Farrin Reid
This page is out of date. Refresh to see the latest.
12 node_modules/htmlparser/newparser.js
View
@@ -1,6 +1,6 @@
//node --prof --prof_auto profile.js
//deps/v8/tools/mac-tick-processor v8.log
-var sys = require("sys");
+var util = require('util');
var fs = require("fs");
var testHtml = "./testdata/api.html"; //Test HTML file to load
@@ -21,9 +21,9 @@ function timeExecutions (loops, func) {
return(getMillisecs() - start);
}
-sys.puts("HTML Length: " + html.length);
+util.puts("HTML Length: " + html.length);
-sys.puts("Test 1: " + timeExecutions(testIterations, function () {
+util.puts("Test 1: " + timeExecutions(testIterations, function () {
// function parseText (data) {
// //
// }
@@ -42,13 +42,13 @@ sys.puts("Test 1: " + timeExecutions(testIterations, function () {
, pos: 0
}
while (data.meta.length > data.meta.pos && data[data.meta.pos++] !== "");
-// sys.puts("Found: " + [data.meta.pos, data[data.meta.pos]]);
+// util.puts("Found: " + [data.meta.pos, data[data.meta.pos]]);
}) + "ms");
-sys.puts("Test 2: " + timeExecutions(testIterations, function () {
+util.puts("Test 2: " + timeExecutions(testIterations, function () {
var data = html;
var dataLen = data.length;
var pos = 0;
while (dataLen > pos && data.charAt(pos++) !== "");
-// sys.puts("Found: " + [pos, data.charAt(pos)]);
+// util.puts("Found: " + [pos, data.charAt(pos)]);
}) + "ms");
12 node_modules/htmlparser/profile.js
View
@@ -1,6 +1,6 @@
//node --prof --prof_auto profile.js
//deps/v8/tools/mac-tick-processor v8.log
-var sys = require("sys");
+var util = require('util');
var fs = require("fs");
var http = require("http");
var htmlparser = require("./lib/htmlparser");
@@ -39,7 +39,7 @@ http.createClient(testPort, testHost)
var timeNodeHtmlParser = !testNHP ? 0 : timeExecutions(testIterations, function () {
var handler = new htmlparser.DefaultHandler(function(err, dom) {
if (err)
- sys.debug("Error: " + err);
+ util.debug("Error: " + err);
});
var parser = new htmlparser.Parser(handler, { includeLocation: true });
parser.parseComplete(html);
@@ -50,14 +50,14 @@ http.createClient(testPort, testHost)
})
if (testNHP)
- sys.debug("NodeHtmlParser: " + timeNodeHtmlParser);
+ util.debug("NodeHtmlParser: " + timeNodeHtmlParser);
if (testLXJS)
- sys.debug("LibXmlJs: " + timeLibXmlJs);
+ util.debug("LibXmlJs: " + timeLibXmlJs);
if (testNHP && testLXJS)
- sys.debug("Difference: " + ((timeNodeHtmlParser - timeLibXmlJs) / timeLibXmlJs) * 100);
+ util.debug("Difference: " + ((timeNodeHtmlParser - timeLibXmlJs) / timeLibXmlJs) * 100);
});
}
else
- sys.debug("Error: got response status " + response.statusCode);
+ util.debug("Error: got response status " + response.statusCode);
})
.end();
6 node_modules/htmlparser/rssbug.js
View
@@ -1,6 +1,6 @@
//node --prof --prof_auto profile.js
//deps/v8/tools/mac-tick-processor v8.log
-var sys = require("sys");
+var util = require('util');
var fs = require("fs");
var htmlparser = require("./node-htmlparser");
@@ -8,9 +8,9 @@ var rss = fs.readFileSync("rssbug.rss");
var handler = new htmlparser.DefaultHandler(function(err, dom) {
if (err)
- sys.debug("Error: " + err);
+ util.debug("Error: " + err);
else
- sys.debug(sys.inspect(dom, false, null));
+ util.debug(util.inspect(dom, false, null));
}, { verbose: false });
var parser = new htmlparser.Parser(handler);
parser.parseComplete(rss);
26 node_modules/htmlparser/runtests.js
View
@@ -19,7 +19,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
***********************************************/
-var sys = require("sys");
+var util = require('util');
var fs = require("fs");
var htmlparser = require("./lib/htmlparser");
@@ -37,7 +37,7 @@ for (var i in testFiles) {
var test = require(testFolder + "/" + moduleName);
var handlerCallback = function handlerCallback (error) {
if (error)
- sys.puts("Handler error: " + error);
+ util.puts("Handler error: " + error);
}
var handler = (test.type == "rss") ?
new htmlparser.RssHandler(handlerCallback, test.options.handler)
@@ -56,20 +56,20 @@ for (var i in testFiles) {
parser.done();
var resultChunk = handler.dom;
var testResult =
- sys.inspect(resultComplete, false, null) === sys.inspect(test.expected, false, null)
+ util.inspect(resultComplete, false, null) === util.inspect(test.expected, false, null)
&&
- sys.inspect(resultChunk, false, null) === sys.inspect(test.expected, false, null)
+ util.inspect(resultChunk, false, null) === util.inspect(test.expected, false, null)
;
- sys.puts("[" + test.name + "\]: " + (testResult ? "passed" : "FAILED"));
+ util.puts("[" + test.name + "\]: " + (testResult ? "passed" : "FAILED"));
if (!testResult) {
failedCount++;
- sys.puts("== Complete ==");
- sys.puts(sys.inspect(resultComplete, false, null));
- sys.puts("== Chunked ==");
- sys.puts(sys.inspect(resultChunk, false, null));
- sys.puts("== Expected ==");
- sys.puts(sys.inspect(test.expected, false, null));
+ util.puts("== Complete ==");
+ util.puts(util.inspect(resultComplete, false, null));
+ util.puts("== Chunked ==");
+ util.puts(util.inspect(resultChunk, false, null));
+ util.puts("== Expected ==");
+ util.puts(util.inspect(test.expected, false, null));
}
}
-sys.puts("Total tests: " + testCount);
-sys.puts("Failed tests: " + failedCount);
+util.puts("Total tests: " + testCount);
+util.puts("Failed tests: " + failedCount);
6 node_modules/htmlparser/snippet.js
View
@@ -1,15 +1,15 @@
//node --prof --prof_auto profile.js
//deps/v8/tools/mac-tick-processor v8.log
-var sys = require("sys");
+var util = require('util');
var htmlparser = require("./htmlparser");
var html = "<link>text</link>";
var handler = new htmlparser.DefaultHandler(function(err, dom) {
if (err)
- sys.debug("Error: " + err);
+ util.debug("Error: " + err);
else
- sys.debug(sys.inspect(dom, false, null));
+ util.debug(util.inspect(dom, false, null));
}, { enforceEmptyTags: true });
var parser = new htmlparser.Parser(handler);
parser.parseComplete(html);
22 node_modules/htmlparser/utils_example.js
View
@@ -1,34 +1,34 @@
//node --prof --prof_auto profile.js
//deps/v8/tools/mac-tick-processor v8.log
-var sys = require("sys");
+var util = require('util');
var htmlparser = require("./lib/htmlparser");
var html = "<a>text a</a><b id='x'>text b</b><c class='y'>text c</c><d id='z' class='w'><e>text e</e></d><g class='g h i'>hhh</g><yy>hellow</yy><yy id='secondyy'>world</yy>";
var handler = new htmlparser.DefaultHandler(function(err, dom) {
if (err) {
- sys.debug("Error: " + err);
+ util.debug("Error: " + err);
}
else {
- sys.debug(sys.inspect(dom, false, null));
+ util.debug(util.inspect(dom, false, null));
var id = htmlparser.DomUtils.getElementById("x", dom);
- sys.debug("id: " + sys.inspect(id, false, null));
+ util.debug("id: " + util.inspect(id, false, null));
var class = htmlparser.DomUtils.getElements({ class: "y" }, dom);
- sys.debug("class: " + sys.inspect(class, false, null));
+ util.debug("class: " + util.inspect(class, false, null));
var multiclass = htmlparser.DomUtils.getElements({ class: function (value) { return(value && value.indexOf("h") > -1); } }, dom);
- sys.debug("multiclass: " + sys.inspect(multiclass, false, null));
+ util.debug("multiclass: " + util.inspect(multiclass, false, null));
var name = htmlparser.DomUtils.getElementsByTagName("a", dom);
- sys.debug("name: " + sys.inspect(name, false, null));
+ util.debug("name: " + util.inspect(name, false, null));
var text = htmlparser.DomUtils.getElementsByTagType("text", dom);
- sys.debug("text: " + sys.inspect(text, false, null));
+ util.debug("text: " + util.inspect(text, false, null));
var nested = htmlparser.DomUtils.getElements({ tag_name: "d", id: "z", class: "w" }, dom);
nested = htmlparser.DomUtils.getElementsByTagName("e", nested);
nested = htmlparser.DomUtils.getElementsByTagType("text", nested);
- sys.debug("nested: " + sys.inspect(nested, false, null));
+ util.debug("nested: " + util.inspect(nested, false, null));
var double = htmlparser.DomUtils.getElementsByTagName("yy", dom);
- sys.debug("double: " + sys.inspect(double, false, null));
+ util.debug("double: " + util.inspect(double, false, null));
var single = htmlparser.DomUtils.getElements( { tag_name: "yy", id: "secondyy" }, dom);
- sys.debug("single: " + sys.inspect(single, false, null));
+ util.debug("single: " + util.inspect(single, false, null));
}
}, { verbose: false });
var parser = new htmlparser.Parser(handler);
20 node_modules/jsdom/example/browser/browser.js
View
@@ -1,5 +1,5 @@
-var sys = require('sys');
+var util = require('util');
var dom = require('../../lib/jsdom/level2/html').dom.level2.html;
var browser = require('../../lib/jsdom/browser/index').windowAugmentation(dom);
@@ -24,14 +24,14 @@ el2.id = 'foo2bar';
el2.innerHTML = '<em class="odd">This is a test</em> This <strong>is another</strong> test ';
browser.document.body.appendChild(el2);
-sys.puts('getElementByid(foo2bar): ' + browser.document.getElementById('foo2bar'));
-sys.puts('getElementByid(foo): ' + browser.document.getElementById('foo'));
-sys.puts('getElementByTagName(em): ' + browser.document.getElementsByTagName('em'));
-sys.puts('getElementByClassName(odd): ' + browser.document.getElementsByClassName('odd'));
+util.puts('getElementByid(foo2bar): ' + browser.document.getElementById('foo2bar'));
+util.puts('getElementByid(foo): ' + browser.document.getElementById('foo'));
+util.puts('getElementByTagName(em): ' + browser.document.getElementsByTagName('em'));
+util.puts('getElementByClassName(odd): ' + browser.document.getElementsByClassName('odd'));
-sys.puts('');
-sys.puts('document.body.outerHTML: ');
-sys.puts(document.body.outerHTML);
+util.puts('');
+util.puts('document.body.outerHTML: ');
+util.puts(document.body.outerHTML);
-sys.puts('document.outerHTML: ');
-sys.puts(document.outerHTML);
+util.puts('document.outerHTML: ');
+util.puts(document.outerHTML);
2  node_modules/jsdom/example/pure/pure.js
View
@@ -632,7 +632,7 @@ exports.pureInit = function(window, document) {
pa = document.createElement('SPAN');
}
- var sys = require("sys");
+ var util = require('util');
ep = elm.parentNode;
// avoid IE mem leak
ep.insertBefore(pa, elm);
6 node_modules/jsdom/example/pure/run.js
View
@@ -1,7 +1,7 @@
var browser = require("../../lib/jsdom/browser/index");
var dom = new browser.browserAugmentation(require("../../lib/jsdom/level2/html").dom.level2.html);
var sax = require("./sax");
-var sys = require("sys");
+var util = require('util');
// TODO: change this example to use pluggable parser
@@ -83,14 +83,14 @@ doc.implementation = implementation;
doc.innerHTML = '<html><head></head><body><div class="who"></div></body></html>';
var window = {
- alert : function() { sys.puts(sys.inspect(arguments)); },
+ alert : function() { util.puts(util.inspect(arguments)); },
document : doc
};
window.Sizzle = require("../sizzle/sizzle").sizzleInit(window, doc);
var $ = require("./pure").pureInit(window, doc);
$("div").autoRender({"who":"Hello Wrrrld"});
-sys.puts(doc.innerHTML);
+util.puts(doc.innerHTML);
4 node_modules/jsdom/example/sizzle/run.js
View
@@ -1,7 +1,7 @@
var browser = require("../../lib/jsdom/browser");
var dom = browser.browserAugmentation(require("../../lib/jsdom/level2/core").dom.level2.core);
-var sys = require("sys");
+var util = require('util');
var doc = new dom.Document("html");
@@ -161,6 +161,6 @@ var sys = require("sys");
var sizzleSandbox = {};
var sizzle = require("./sizzle").sizzleInit(sizzleSandbox, doc);
-sys.puts(sys.inspect(sizzle('.classy,p acronym#theid').length));
+util.puts(util.inspect(sizzle('.classy,p acronym#theid').length));
2  node_modules/jsdom/lib/jsdom/browser/domtohtml.js
View
@@ -209,7 +209,7 @@ exports.generateHtmlRecursive = function generateHtmlRecursive(node, rawText) {
break;
}
}
- //require('sys').puts(require('sys').inspect(ret));
+ //require('util').puts(require('util').inspect(ret));
return ret;
};
18 node_modules/jsdom/lib/jsdom/browser/htmltodom.js
View
@@ -99,15 +99,15 @@ function HtmlToDom(parser) {
} else {
this.appendHtmlToElement = function(){
- var sys = require('sys');
- sys.puts('');
- sys.puts('###########################################################');
- sys.puts('# WARNING: No HTML parser could be found.');
- sys.puts('# Element.innerHTML setter support has been disabled');
- sys.puts('# Element.innerHTML getter support will still function');
- sys.puts('# Download: http://github.com/tautologistics/node-htmlparser');
- sys.puts('###########################################################');
- sys.puts('');
+ var util = require('util');
+ util.puts('');
+ util.puts('###########################################################');
+ util.puts('# WARNING: No HTML parser could be found.');
+ util.puts('# Element.innerHTML setter support has been disabled');
+ util.puts('# Element.innerHTML getter support will still function');
+ util.puts('# Download: http://github.com/tautologistics/node-htmlparser');
+ util.puts('###########################################################');
+ util.puts('');
};
}
2  node_modules/jsdom/lib/jsdom/browser/index.js
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
http = require('http'),
URL = require('url'),
HtmlToDom = require('./htmltodom').HtmlToDom,
2  node_modules/jsdom/lib/jsdom/level2/events.js
View
@@ -4,7 +4,7 @@
*
*/
var core = require("./core").dom.level2.core,
- sys = require("sys");
+ util = require('util');
var events = {};
2  node_modules/jsdom/test/jsdom/index.js
View
@@ -1,4 +1,4 @@
-var sys = require("sys"),
+var util = require('util'),
path = require("path");
exports.tests = {
2  node_modules/jsdom/test/level2/events.js
View
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
6 node_modules/jsdom/test/runner.js
View
@@ -1,4 +1,4 @@
-var sys = require("sys"),
+var util = require('util'),
fs = require("fs");
var mixin = function(target) {
@@ -59,9 +59,9 @@ global.debug = function(val) {
try {
str = JSON.stringify(val, null, " ");
} catch (e) {
- str = sys.inspect(val, null, true);
+ str = util.inspect(val, null, true);
}
- sys.debug(str);
+ util.debug(str);
process.exit();
}
2  node_modules/nomnom.js
View
@@ -1,4 +1,4 @@
-var sys = require("sys");
+var util = require('util');
ArgParser = function(options, parserOpts) {
parserOpts = parserOpts || {};
this.print = parserOpts.printFunc || this.print;
Something went wrong with that request. Please try again.