mirror of https://github.com/lukechilds/node.git
Jeremy Martin
14 years ago
committed by
Ryan Dahl
2 changed files with 41 additions and 7 deletions
@ -0,0 +1,27 @@ |
|||||
|
common = require("../common"); |
||||
|
assert = common.assert |
||||
|
var events = require('events'); |
||||
|
|
||||
|
var e = new events.EventEmitter(), |
||||
|
num_args_emited = []; |
||||
|
|
||||
|
e.on("numArgs", function() { |
||||
|
var numArgs = arguments.length; |
||||
|
console.log("numArgs: " + numArgs); |
||||
|
num_args_emited.push(numArgs); |
||||
|
}); |
||||
|
|
||||
|
console.log("start"); |
||||
|
|
||||
|
e.emit("numArgs"); |
||||
|
e.emit("numArgs", null); |
||||
|
e.emit("numArgs", null, null); |
||||
|
e.emit("numArgs", null, null, null); |
||||
|
e.emit("numArgs", null, null, null, null); |
||||
|
e.emit("numArgs", null, null, null, null, null); |
||||
|
|
||||
|
process.addListener("exit", function () { |
||||
|
assert.deepEqual([0, 1, 2, 3, 4, 5], num_args_emited); |
||||
|
}); |
||||
|
|
||||
|
|
Loading…
Reference in new issue