Skip to content

Commit

Permalink
fixup! lib: mask mode_t type of arguments with 0o777
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed May 17, 2018
1 parent 6fa590b commit 37af759
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,10 @@ function verifyStatObject(stat) {
await fchmod(handle, 0o666);
await handle.chmod(0o666);

// `mode` can't be > 0o777
assert.rejects(
async () => chmod(handle, (0o777 + 1)),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
}
);
assert.rejects(
async () => fchmod(handle, (0o777 + 1)),
{
code: 'ERR_OUT_OF_RANGE',
name: 'RangeError [ERR_OUT_OF_RANGE]'
}
);
assert.rejects(
async () => handle.chmod(handle, (0o777 + 1)),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
}
);
// Mode larger than 0o777 should be masked off.
await chmod(dest, (0o777 + 1));
await fchmod(handle, 0o777 + 1);
await handle.chmod(0o777 + 1);

await utimes(dest, new Date(), new Date());

Expand Down

0 comments on commit 37af759

Please sign in to comment.