Skip to content

Minor bug in the example from 'Inheriting from EventEmitter' section #285

Closed
@ManasJayanth

Description

@ManasJayanth

Inheriting from EventEmitter section requires events and incorrectly assigns to EventEmitter object.

const EventEmitter = require('events');

It should be

const EventEmitter = require('events').EventEmitter;

Even while introducing EventEmitter class, it mentions var EventEmitter = require('events'); which should have been var EventEmitter = require('events').EventEmitter;

Run the code otherwise complains TypeError: Object prototype may only be an Object or null, which is understandable as object returned by simply requiring events does not have prototype property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions