-
Notifications
You must be signed in to change notification settings - Fork 29.1k
/
test-worker-unsupported-things.js
40 lines (35 loc) · 1.28 KB
/
test-worker-unsupported-things.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const common = require('../common');
const assert = require('assert');
const { Worker, isMainThread, parentPort } = require('worker_threads');
if (isMainThread) {
const w = new Worker(__filename);
w.on('message', common.mustCall((message) => {
assert.strictEqual(message, true);
}));
} else {
{
const before = process.title;
process.title += ' in worker';
assert.strictEqual(process.title, before);
}
{
const before = process.debugPort;
process.debugPort++;
assert.strictEqual(process.debugPort, before);
}
assert.strictEqual('abort' in process, false);
assert.strictEqual('chdir' in process, false);
assert.strictEqual('setuid' in process, false);
assert.strictEqual('seteuid' in process, false);
assert.strictEqual('setgid' in process, false);
assert.strictEqual('setegid' in process, false);
assert.strictEqual('setgroups' in process, false);
assert.strictEqual('initgroups' in process, false);
assert.strictEqual('_startProfilerIdleNotifier' in process, false);
assert.strictEqual('_stopProfilerIdleNotifier' in process, false);
assert.strictEqual('_debugProcess' in process, false);
assert.strictEqual('_debugPause' in process, false);
assert.strictEqual('_debugEnd' in process, false);
parentPort.postMessage(true);
}