summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-10-15 01:08:36 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2011-10-15 01:08:36 +0200
commit018e110cd11720997e49c9b270ecc50a04de4ece (patch)
tree7573cccca0be5399b964e015faaf94055dfeef37 /test/fixtures
parent3108a9ee3831b8b0a40a09314a005ef2430dacbc (diff)
downloadnodejs-018e110cd11720997e49c9b270ecc50a04de4ece.tar.gz
nodejs-018e110cd11720997e49c9b270ecc50a04de4ece.tar.bz2
nodejs-018e110cd11720997e49c9b270ecc50a04de4ece.zip
test: replace .addListener() calls with .on()
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/a.js2
-rw-r--r--test/fixtures/b/c.js2
-rw-r--r--test/fixtures/b/d.js2
-rw-r--r--test/fixtures/echo.js4
-rw-r--r--test/fixtures/net-fd-passing-receiver.js10
-rw-r--r--test/fixtures/recvfd.js6
-rw-r--r--test/fixtures/should_exit.js2
-rw-r--r--test/fixtures/stdio-filter.js2
8 files changed, 15 insertions, 15 deletions
diff --git a/test/fixtures/a.js b/test/fixtures/a.js
index 3e4975841..fa010b07b 100644
--- a/test/fixtures/a.js
+++ b/test/fixtures/a.js
@@ -41,6 +41,6 @@ exports.D = function() {
exports.number = 42;
-process.addListener('exit', function() {
+process.on('exit', function() {
string = 'A done';
});
diff --git a/test/fixtures/b/c.js b/test/fixtures/b/c.js
index a8a3a272b..6e5080d77 100644
--- a/test/fixtures/b/c.js
+++ b/test/fixtures/b/c.js
@@ -43,7 +43,7 @@ exports.D = function() {
return d.D();
};
-process.addListener('exit', function() {
+process.on('exit', function() {
string = 'C done';
console.log('b/c.js exit');
});
diff --git a/test/fixtures/b/d.js b/test/fixtures/b/d.js
index ef449f679..37fefc2d3 100644
--- a/test/fixtures/b/d.js
+++ b/test/fixtures/b/d.js
@@ -27,7 +27,7 @@ exports.D = function() {
return string;
};
-process.addListener('exit', function() {
+process.on('exit', function() {
string = 'D done';
});
diff --git a/test/fixtures/echo.js b/test/fixtures/echo.js
index 689096c1a..1e6c6b959 100644
--- a/test/fixtures/echo.js
+++ b/test/fixtures/echo.js
@@ -26,10 +26,10 @@ common.print('hello world\r\n');
var stdin = process.openStdin();
-stdin.addListener('data', function(data) {
+stdin.on('data', function(data) {
process.stdout.write(data.toString());
});
-stdin.addListener('end', function() {
+stdin.on('end', function() {
process.stdout.end();
});
diff --git a/test/fixtures/net-fd-passing-receiver.js b/test/fixtures/net-fd-passing-receiver.js
index 04a143c18..8e0ba14a7 100644
--- a/test/fixtures/net-fd-passing-receiver.js
+++ b/test/fixtures/net-fd-passing-receiver.js
@@ -26,19 +26,19 @@ path = process.ARGV[2];
greeting = process.ARGV[3];
receiver = net.createServer(function(socket) {
- socket.addListener('fd', function(fd) {
+ socket.on('fd', function(fd) {
var peerInfo = process.getpeername(fd);
peerInfo.fd = fd;
var passedSocket = new net.Socket(peerInfo);
- passedSocket.addListener('eof', function() {
+ passedSocket.on('eof', function() {
passedSocket.close();
});
- passedSocket.addListener('data', function(data) {
+ passedSocket.on('data', function(data) {
passedSocket.send('[echo] ' + data);
});
- passedSocket.addListener('close', function() {
+ passedSocket.on('close', function() {
receiver.close();
});
passedSocket.send('[greeting] ' + greeting);
@@ -46,7 +46,7 @@ receiver = net.createServer(function(socket) {
});
/* To signal the test runne we're up and listening */
-receiver.addListener('listening', function() {
+receiver.on('listening', function() {
common.print('ready');
});
diff --git a/test/fixtures/recvfd.js b/test/fixtures/recvfd.js
index 8f7b06612..472387815 100644
--- a/test/fixtures/recvfd.js
+++ b/test/fixtures/recvfd.js
@@ -51,7 +51,7 @@ function processData(s) {
}
};
- pipeStream.addListener('drain', drainFunc);
+ pipeStream.on('drain', drainFunc);
pipeStream.resume();
if (pipeStream.write(JSON.stringify(d) + '\n')) {
@@ -62,11 +62,11 @@ function processData(s) {
// Create a UNIX socket to the path defined by argv[2] and read a file
// descriptor and misc data from it.
var s = new net.Stream();
-s.addListener('fd', function(fd) {
+s.on('fd', function(fd) {
receivedFDs.unshift(fd);
processData(s);
});
-s.addListener('data', function(data) {
+s.on('data', function(data) {
data.toString('utf8').trim().split('\n').forEach(function(d) {
receivedData.unshift(JSON.parse(d));
});
diff --git a/test/fixtures/should_exit.js b/test/fixtures/should_exit.js
index 1d80c5210..fd16817d7 100644
--- a/test/fixtures/should_exit.js
+++ b/test/fixtures/should_exit.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function tmp() {}
-process.addListener('SIGINT', tmp);
+process.on('SIGINT', tmp);
process.removeListener('SIGINT', tmp);
setInterval(function() {
process.stdout.write('keep alive\n');
diff --git a/test/fixtures/stdio-filter.js b/test/fixtures/stdio-filter.js
index c6daf9aed..9bb9af59e 100644
--- a/test/fixtures/stdio-filter.js
+++ b/test/fixtures/stdio-filter.js
@@ -26,7 +26,7 @@ var replacement = process.argv[3];
var re = new RegExp(regexIn, 'g');
var stdin = process.openStdin();
-stdin.addListener('data', function(data) {
+stdin.on('data', function(data) {
data = data.toString();
process.stdout.write(data.replace(re, replacement));
});