Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logPossibleMemoryLeak throws an error when event name is a Symbol #296

Open
doronguttman opened this issue Nov 19, 2022 · 0 comments
Open

Comments

@doronguttman
Copy link

When eventName is a Symbol AND maxListeners threshold is exceeded AND verboseMemoryLeak is true, the following error will be thrown:

TypeError: Cannot convert a Symbol value to a string
      at EventEmitter.logPossibleMemoryLeak (node_modules/eventemitter2/lib/eventemitter2.js:60:35)
      at EventEmitter._on (node_modules/eventemitter2/lib/eventemitter2.js:1267:31)
      at EventEmitter.on (node_modules/eventemitter2/lib/eventemitter2.js:1178:17)

This is caused by the following line:

      errorMsg += ' Event name: ' + eventName + '.';

as a Symbol cannot be implicitly converted to a string. see here.

doronguttman added a commit to doronguttman/EventEmitter2 that referenced this issue Nov 19, 2022
doronguttman added a commit to doronguttman/EventEmitter2 that referenced this issue Nov 19, 2022
doronguttman added a commit to doronguttman/EventEmitter2 that referenced this issue Nov 19, 2022
doronguttman added a commit to doronguttman/EventEmitter2 that referenced this issue Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant