Skip to content

Commit 37af759

Browse files
committed
fixup! lib: mask mode_t type of arguments with 0o777
1 parent 6fa590b commit 37af759

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

test/parallel/test-fs-promises.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,10 @@ function verifyStatObject(stat) {
113113
await fchmod(handle, 0o666);
114114
await handle.chmod(0o666);
115115

116-
// `mode` can't be > 0o777
117-
assert.rejects(
118-
async () => chmod(handle, (0o777 + 1)),
119-
{
120-
code: 'ERR_INVALID_ARG_TYPE',
121-
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
122-
}
123-
);
124-
assert.rejects(
125-
async () => fchmod(handle, (0o777 + 1)),
126-
{
127-
code: 'ERR_OUT_OF_RANGE',
128-
name: 'RangeError [ERR_OUT_OF_RANGE]'
129-
}
130-
);
131-
assert.rejects(
132-
async () => handle.chmod(handle, (0o777 + 1)),
133-
{
134-
code: 'ERR_INVALID_ARG_TYPE',
135-
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
136-
}
137-
);
116+
// Mode larger than 0o777 should be masked off.
117+
await chmod(dest, (0o777 + 1));
118+
await fchmod(handle, 0o777 + 1);
119+
await handle.chmod(0o777 + 1);
138120

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

0 commit comments

Comments
 (0)