Skip to content

Commit

Permalink
events: preset usingDomains to false
Browse files Browse the repository at this point in the history
The line setting this was removed in a previous commit. This
potentially breaks code in the wild using this property.

Refs: #17403 (comment)
PR-URL: #18944
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
MylesBorins committed Feb 23, 2018
1 parent 927c1b1 commit 761caec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module.exports = EventEmitter;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;

EventEmitter.usingDomains = false;

EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-event-emitter-subclass.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function MyEE(cb) {

const myee = new MyEE(common.mustCall());

myee.hasOwnProperty('usingDomains');

This comment has been minimized.

Copy link
@stenalpjolly

stenalpjolly Mar 2, 2018

What does this line do?
Does it have any effect?

This comment has been minimized.

Copy link
@richardlau

richardlau Mar 2, 2018

Member

I think this should have been wrapped in an assert.

This comment has been minimized.

Copy link
@MylesBorins

MylesBorins Mar 2, 2018

Author Contributor

Hmm, I could have sworn it was in the pr

This comment has been minimized.

Copy link
@apapirovski

apapirovski Mar 2, 2018

Member

This wasn't actually correct anyway. It should test MyEE not the instance created.

This comment has been minimized.

Copy link
@richardlau

richardlau Mar 2, 2018

Member

util.inherits(ErrorEE, EventEmitter);
function ErrorEE() {
Expand Down

0 comments on commit 761caec

Please sign in to comment.