• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3// This tests that the lower bits of mode > 0o777 still works in
4// process.umask()
5
6const common = require('../common');
7const assert = require('assert');
8
9if (!common.isMainThread)
10  common.skip('Setting process.umask is not supported in Workers');
11
12let mask;
13
14if (common.isWindows) {
15  mask = 0o600;
16} else {
17  mask = 0o664;
18}
19
20const maskToIgnore = 0o10000;
21
22const old = process.umask();
23
24function test(input, output) {
25  process.umask(input);
26  assert.strictEqual(process.umask(), output);
27
28  process.umask(old);
29}
30
31test(mask | maskToIgnore, mask);
32test((mask | maskToIgnore).toString(8), mask);
33