Skip to content

Function deprecated, change "process.EventEmitter.prototype" #47

@mayankpatel90

Description

@mayankpatel90

root@mayank-Vostro-460# cd wikistream
root@mayank-Vostro-460:~/wikistream# gedit node_modules/policyfile/lib/server.js

"gedit node_modules/policyfile/lib/server.js"

/New code,/
/**

  • Proxy the event listener requests to the created Net server
    */
    var EventEmitter = require('events');
    Object.keys(EventEmitter.prototype).forEach(function proxy (key){
    Server.prototype[key] = Server.prototype[key] || function () {
    if (this.socket) {
    this.socket[key].apply(this.socket, arguments);
    }

    return this;
    };
    });

/******* old code*************/
/**

  • Proxy the event listener requests to the created Net server
    */
    Object.keys(process.EventEmitter.prototype).forEach(function proxy (key){
    Server.prototype[key] = Server.prototype[key] || function () {
    if (this.socket) {
    this.socket[key].apply(this.socket, arguments);
    }

    return this;
    };
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions