|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 "use strict"; |
|
6 |
|
7 module.metadata = { |
|
8 "stability": "unstable" |
|
9 }; |
|
10 |
|
11 const { |
|
12 exit, version, stdout, stderr, platform, architecture |
|
13 } = require("../system"); |
|
14 |
|
15 /** |
|
16 * Supported |
|
17 */ |
|
18 |
|
19 exports.stdout = stdout; |
|
20 exports.stderr = stderr; |
|
21 exports.version = version; |
|
22 exports.versions = {}; |
|
23 exports.config = {}; |
|
24 exports.arch = architecture; |
|
25 exports.platform = platform; |
|
26 exports.exit = exit; |
|
27 |
|
28 /** |
|
29 * Partial support |
|
30 */ |
|
31 |
|
32 // An alias to `setTimeout(fn, 0)`, which isn't the same as node's `nextTick`, |
|
33 // but atleast ensures it'll occur asynchronously |
|
34 exports.nextTick = (callback) => setTimeout(callback, 0); |
|
35 |
|
36 /** |
|
37 * Unsupported |
|
38 */ |
|
39 |
|
40 exports.maxTickDepth = 1000; |
|
41 exports.pid = 0; |
|
42 exports.title = ""; |
|
43 exports.stdin = {}; |
|
44 exports.argv = []; |
|
45 exports.execPath = ""; |
|
46 exports.execArgv = []; |
|
47 exports.abort = function () {}; |
|
48 exports.chdir = function () {}; |
|
49 exports.cwd = function () {}; |
|
50 exports.env = {}; |
|
51 exports.getgid = function () {}; |
|
52 exports.setgid = function () {}; |
|
53 exports.getuid = function () {}; |
|
54 exports.setuid = function () {}; |
|
55 exports.getgroups = function () {}; |
|
56 exports.setgroups = function () {}; |
|
57 exports.initgroups = function () {}; |
|
58 exports.kill = function () {}; |
|
59 exports.memoryUsage = function () {}; |
|
60 exports.umask = function () {}; |
|
61 exports.uptime = function () {}; |
|
62 exports.hrtime = function () {}; |