Skip to content

Commit a9d93fb

Browse files
committed
Replace deprecated sys.puts calls with console.log in tests
1 parent efc39e9 commit a9d93fb

9 files changed

+14
-14
lines changed

example/demo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
44
var xhr = new XMLHttpRequest();
55

66
xhr.onreadystatechange = function() {
7-
sys.puts("State: " + this.readyState);
8-
7+
console.log("State: " + this.readyState);
8+
99
if (this.readyState == 4) {
10-
sys.puts("Complete.\nBody length: " + this.responseText.length);
11-
sys.puts("Body:\n" + this.responseText);
10+
console.log("Complete.\nBody length: " + this.responseText.length);
11+
console.log("Body:\n" + this.responseText);
1212
}
1313
};
1414

tests/test-constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ assert.equal(2, xhr.HEADERS_RECEIVED);
1010
assert.equal(3, xhr.LOADING);
1111
assert.equal(4, xhr.DONE);
1212

13-
sys.puts("done");
13+
console.log("done");

tests/test-events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var server = http.createServer(function (req, res) {
2020
assert.equal(onreadystatechange, true);
2121
assert.equal(readystatechange, true);
2222
assert.equal(removed, true);
23-
sys.puts("done");
23+
console.log("done");
2424
this.close();
2525
}).listen(8000);
2626

tests/test-headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ xhr.onreadystatechange = function() {
4747
assert.equal("", this.getAllResponseHeaders());
4848
assert.equal(null, this.getResponseHeader("Connection"));
4949

50-
sys.puts("done");
50+
console.log("done");
5151
}
5252
};
5353

tests/test-redirect-302.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ xhr.onreadystatechange = function() {
2929
if (this.readyState == 4) {
3030
assert.equal(xhr.getRequestHeader('Location'), '');
3131
assert.equal(xhr.responseText, "Hello World");
32-
sys.puts("done");
32+
console.log("done");
3333
}
3434
};
3535

tests/test-redirect-303.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ xhr.onreadystatechange = function() {
2929
if (this.readyState == 4) {
3030
assert.equal(xhr.getRequestHeader('Location'), '');
3131
assert.equal(xhr.responseText, "Hello World");
32-
sys.puts("done");
32+
console.log("done");
3333
}
3434
};
3535

tests/test-redirect-307.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ xhr.onreadystatechange = function() {
3131
if (this.readyState == 4) {
3232
assert.equal(xhr.getRequestHeader('Location'), '');
3333
assert.equal(xhr.responseText, "Hello World");
34-
sys.puts("done");
34+
console.log("done");
3535
}
3636
};
3737

tests/test-request-methods.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var server = http.createServer(function (req, res) {
2424

2525
if (curMethod == methods.length - 1) {
2626
this.close();
27-
sys.puts("done");
27+
console.log("done");
2828
}
2929
}).listen(8000);
3030

@@ -47,7 +47,7 @@ function start(method) {
4747
curMethod++;
4848

4949
if (curMethod < methods.length) {
50-
sys.puts("Testing " + methods[curMethod]);
50+
console.log("Testing " + methods[curMethod]);
5151
start(methods[curMethod]);
5252
}
5353
}
@@ -58,5 +58,5 @@ function start(method) {
5858
xhr.send();
5959
}
6060

61-
sys.puts("Testing " + methods[curMethod]);
61+
console.log("Testing " + methods[curMethod]);
6262
start(methods[curMethod]);

tests/test-request-protocols.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var runSync = function() {
2424
xhr.onreadystatechange = function() {
2525
if (this.readyState == 4) {
2626
assert.equal("Hello World", this.responseText);
27-
sys.puts("done");
27+
console.log("done");
2828
}
2929
};
3030
xhr.open("GET", url, false);

0 commit comments

Comments
 (0)