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

domain,events: support non-object 'error' argument #11438

Merged
merged 1 commit into from
Feb 22, 2017

Conversation

bnoordhuis
Copy link
Member

Fix a TypeError when emitting an 'error' argument with a non-object
argument (like a string) when domains are active.

Refs: nodejs/help#501

@bnoordhuis bnoordhuis added the domain Issues and PRs related to the domain subsystem. label Feb 17, 2017
@nodejs-github-bot nodejs-github-bot added the events Issues and PRs related to the events subsystem / EventEmitter. label Feb 17, 2017
@bnoordhuis
Copy link
Member Author

I extended the test coverage from just strings to other primitives. It's a little awkward though: truthy values are passed through as-is while falsy values are replaced with an Error object. But hey, it's backwards compatible.

Fix a TypeError when emitting an 'error' argument with a non-object
argument (like a string) when domains are active.

Fixes: nodejs/help#501
PR-URL: nodejs#11438
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@bnoordhuis bnoordhuis closed this Feb 22, 2017
@bnoordhuis bnoordhuis deleted the fix-help-501 branch February 22, 2017 20:43
@bnoordhuis bnoordhuis merged commit 4f638f6 into nodejs:master Feb 22, 2017
addaleax pushed a commit that referenced this pull request Feb 24, 2017
Fix a TypeError when emitting an 'error' argument with a non-object
argument (like a string) when domains are active.

Fixes: nodejs/help#501
PR-URL: #11438
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@italoacasas italoacasas mentioned this pull request Feb 25, 2017
@jasnell
Copy link
Member

jasnell commented Mar 7, 2017

This will need a backport PR to land in v6 and v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain Issues and PRs related to the domain subsystem. events Issues and PRs related to the events subsystem / EventEmitter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants