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

core: throw TypeError if chdir() args don't match signature #274

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jan 9, 2015

A little stab at #264. I'm doing my part!

The compat risk for changing this is pretty low. (there are a lot of other APIs implemented in C++ which should be changed in the same way)


assert.throws('process.chdir({})', TypeError, 'Bad argument.');
assert.throws('process.chdir()', TypeError, 'Bad argument.');
assert.throws('process.chdir("x", "y")', TypeError, 'Bad argument.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is both a V8-ism that works by accident and a bug in the assert module... assert.throws() calls the first argument as a function. The result is a TypeError when the input is a string but it doesn't seem to check that the exception message matches...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that right, let me take a look at the assert module quickly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, looks like it :) I'll just rearrange those

@bnoordhuis
Copy link
Member

@caitp Can you update the commit log so that the first line <= 50 characters?

bnoordhuis pushed a commit that referenced this pull request Jan 9, 2015
PR-URL: #274
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

Thanks Caitlin, landed in be2404e.

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

Successfully merging this pull request may close these issues.

2 participants