process: allow reading umask in workers

Refs: https://github.com/nodejs/node/issues/25448
PR-URL: https://github.com/nodejs/node/pull/25526
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
cjihrig committed 2019-01-17 16:32:21 -05:00
1 parent 1375af204a
commit f6cd4e3e59
10 files changed
+54 -12

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@
const common = require('../common');
if (!common.isMainThread)
common.skip('process.umask is not available in Workers');
common.skip('Setting process.umask is not supported in Workers');
const assert = require('assert');
const path = require('path');
+1 -1
View File
@@ -7,7 +7,7 @@ const common = require('../common');
const assert = require('assert');
if (!common.isMainThread)
common.skip('process.umask is not available in Workers');
common.skip('Setting process.umask is not supported in Workers');
let mask;
+9 -2
View File
@@ -22,8 +22,15 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.isMainThread)
common.skip('process.umask is not available in Workers');
if (!common.isMainThread) {
assert.strictEqual(typeof process.umask(), 'number');
assert.throws(() => {
process.umask('0664');
}, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION' });
common.skip('Setting process.umask is not supported in Workers');
}
// Note in Windows one can only set the "user" bits.
let mask;