-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.eventsIssues and PRs related to the events subsystem / EventEmitter.Issues and PRs related to the events subsystem / EventEmitter.
Description
In the EventEmitter the events are stored in an plain Object
instance. The event names that you use are added directly as property on the object so when you event names such as __proto__
it will break. One solution is to prefix the keys with a char such as ~
.
Example case:
var EventEmitter = require('events').EventEmitter;
var e = new EventEmitter();
e.on('__proto__', function (bar) {
console.log('foo', bar);
});
e.emit('__proto__', 1);
Willing to create pull request if bug requires fixing ;)
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.eventsIssues and PRs related to the events subsystem / EventEmitter.Issues and PRs related to the events subsystem / EventEmitter.