goscript 0.0.49 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/compiler/analysis.go +1021 -561
  2. package/compiler/analysis_test.go +12 -15
  3. package/compiler/compiler.go +75 -39
  4. package/compiler/decl.go +22 -0
  5. package/compiler/expr-call-async.go +239 -40
  6. package/compiler/expr-call-type-conversion.go +6 -10
  7. package/compiler/expr-call.go +58 -27
  8. package/compiler/sanitize.go +1 -2
  9. package/compiler/spec-struct.go +3 -3
  10. package/compiler/spec-value.go +2 -2
  11. package/compiler/spec.go +66 -43
  12. package/compiler/stmt-assign.go +7 -4
  13. package/compiler/stmt-select.go +52 -1
  14. package/compiler/stmt.go +63 -5
  15. package/compiler/type.go +16 -3
  16. package/dist/gs/builtin/builtin.js.map +1 -1
  17. package/dist/gs/builtin/channel.d.ts +2 -2
  18. package/dist/gs/builtin/channel.js +12 -7
  19. package/dist/gs/builtin/channel.js.map +1 -1
  20. package/dist/gs/context/context.d.ts +16 -18
  21. package/dist/gs/context/context.js +23 -13
  22. package/dist/gs/context/context.js.map +1 -1
  23. package/dist/gs/fmt/fmt.js +3 -1
  24. package/dist/gs/fmt/fmt.js.map +1 -1
  25. package/dist/gs/reflect/type.js +5 -8
  26. package/dist/gs/reflect/type.js.map +1 -1
  27. package/dist/gs/syscall/constants.d.ts +24 -0
  28. package/dist/gs/syscall/constants.js +27 -0
  29. package/dist/gs/syscall/constants.js.map +1 -0
  30. package/dist/gs/syscall/env.d.ts +6 -0
  31. package/dist/gs/syscall/env.js +43 -0
  32. package/dist/gs/syscall/env.js.map +1 -0
  33. package/dist/gs/syscall/errors.d.ts +111 -0
  34. package/dist/gs/syscall/errors.js +547 -0
  35. package/dist/gs/syscall/errors.js.map +1 -0
  36. package/dist/gs/syscall/fs.d.ts +29 -0
  37. package/dist/gs/syscall/fs.js +53 -0
  38. package/dist/gs/syscall/fs.js.map +1 -0
  39. package/dist/gs/syscall/index.d.ts +6 -80
  40. package/dist/gs/syscall/index.js +12 -168
  41. package/dist/gs/syscall/index.js.map +1 -1
  42. package/dist/gs/syscall/rawconn.d.ts +7 -0
  43. package/dist/gs/syscall/rawconn.js +19 -0
  44. package/dist/gs/syscall/rawconn.js.map +1 -0
  45. package/dist/gs/syscall/types.d.ts +12 -0
  46. package/dist/gs/syscall/types.js +2 -0
  47. package/dist/gs/syscall/types.js.map +1 -0
  48. package/dist/gs/time/time.d.ts +2 -1
  49. package/dist/gs/time/time.js +29 -19
  50. package/dist/gs/time/time.js.map +1 -1
  51. package/gs/builtin/builtin.ts +1 -7
  52. package/gs/builtin/channel.ts +18 -12
  53. package/gs/context/context.ts +63 -45
  54. package/gs/fmt/fmt.ts +5 -1
  55. package/gs/reflect/type.ts +5 -10
  56. package/gs/syscall/constants.ts +29 -0
  57. package/gs/syscall/env.ts +47 -0
  58. package/gs/syscall/errors.ts +658 -0
  59. package/gs/syscall/fs.ts +62 -0
  60. package/gs/syscall/index.ts +12 -207
  61. package/gs/syscall/rawconn.ts +23 -0
  62. package/gs/syscall/types.ts +18 -0
  63. package/gs/time/time.ts +35 -21
  64. package/package.json +2 -2
  65. package/gs/TODO.md +0 -129
@@ -0,0 +1,6 @@
1
+ import * as $ from '@goscript/builtin/index.js';
2
+ export declare function Getenv(key: string): [string, boolean];
3
+ export declare function Setenv(key: string, value: string): $.GoError;
4
+ export declare function Unsetenv(key: string): $.GoError;
5
+ export declare function Clearenv(): void;
6
+ export declare function Environ(): $.Slice<string>;
@@ -0,0 +1,43 @@
1
+ import * as $ from '@goscript/builtin/index.js';
2
+ // Environment variable functions using Node.js/browser APIs
3
+ export function Getenv(key) {
4
+ if (typeof process !== 'undefined' && process.env) {
5
+ const value = process.env[key];
6
+ return value !== undefined ? [value, true] : ['', false];
7
+ }
8
+ return ['', false];
9
+ }
10
+ export function Setenv(key, value) {
11
+ if (typeof process !== 'undefined' && process.env) {
12
+ process.env[key] = value;
13
+ return null;
14
+ }
15
+ return { Error: () => 'setenv not supported' };
16
+ }
17
+ export function Unsetenv(key) {
18
+ if (typeof process !== 'undefined' && process.env) {
19
+ delete process.env[key];
20
+ return null;
21
+ }
22
+ return { Error: () => 'unsetenv not supported' };
23
+ }
24
+ export function Clearenv() {
25
+ if (typeof process !== 'undefined' && process.env) {
26
+ for (const key in process.env) {
27
+ delete process.env[key];
28
+ }
29
+ }
30
+ }
31
+ export function Environ() {
32
+ if (typeof process !== 'undefined' && process.env) {
33
+ const env = [];
34
+ for (const [key, value] of Object.entries(process.env)) {
35
+ if (value !== undefined) {
36
+ env.push(`${key}=${value}`);
37
+ }
38
+ }
39
+ return $.arrayToSlice(env);
40
+ }
41
+ return $.arrayToSlice([]);
42
+ }
43
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../gs/syscall/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAA;AAE/C,4DAA4D;AAC5D,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC9B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;IACD,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,KAAa;IAC/C,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACvB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,wBAAwB,EAAE,CAAA;AAClD,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACzB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClD,MAAM,GAAG,GAAa,EAAE,CAAA;QACxB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;IACD,OAAO,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { Errno } from './types.js';
2
+ export declare const EPERM: Errno;
3
+ export declare const ENOENT: Errno;
4
+ export declare const ESRCH: Errno;
5
+ export declare const EINTR: Errno;
6
+ export declare const EIO: Errno;
7
+ export declare const ENXIO: Errno;
8
+ export declare const E2BIG: Errno;
9
+ export declare const ENOEXEC: Errno;
10
+ export declare const EBADF: Errno;
11
+ export declare const ECHILD: Errno;
12
+ export declare const EAGAIN: Errno;
13
+ export declare const ENOMEM: Errno;
14
+ export declare const EACCES: Errno;
15
+ export declare const EFAULT: Errno;
16
+ export declare const EBUSY: Errno;
17
+ export declare const EEXIST: Errno;
18
+ export declare const EXDEV: Errno;
19
+ export declare const ENODEV: Errno;
20
+ export declare const ENOTDIR: Errno;
21
+ export declare const EISDIR: Errno;
22
+ export declare const EINVAL: Errno;
23
+ export declare const ENFILE: Errno;
24
+ export declare const EMFILE: Errno;
25
+ export declare const ENOTTY: Errno;
26
+ export declare const EFBIG: Errno;
27
+ export declare const ENOSPC: Errno;
28
+ export declare const ESPIPE: Errno;
29
+ export declare const EROFS: Errno;
30
+ export declare const EMLINK: Errno;
31
+ export declare const EPIPE: Errno;
32
+ export declare const EDOM: Errno;
33
+ export declare const ERANGE: Errno;
34
+ export declare const EDEADLK: Errno;
35
+ export declare const ENAMETOOLONG: Errno;
36
+ export declare const ENOLCK: Errno;
37
+ export declare const ENOSYS: Errno;
38
+ export declare const ENOTEMPTY: Errno;
39
+ export declare const ELOOP: Errno;
40
+ export declare const ENOMSG: Errno;
41
+ export declare const EIDRM: Errno;
42
+ export declare const ECHRNG: Errno;
43
+ export declare const EL2NSYNC: Errno;
44
+ export declare const EL3HLT: Errno;
45
+ export declare const EL3RST: Errno;
46
+ export declare const ELNRNG: Errno;
47
+ export declare const EUNATCH: Errno;
48
+ export declare const ENOCSI: Errno;
49
+ export declare const EL2HLT: Errno;
50
+ export declare const EBADE: Errno;
51
+ export declare const EBADR: Errno;
52
+ export declare const EXFULL: Errno;
53
+ export declare const ENOANO: Errno;
54
+ export declare const EBADRQC: Errno;
55
+ export declare const EBADSLT: Errno;
56
+ export declare const EDEADLOCK: Errno;
57
+ export declare const EBFONT: Errno;
58
+ export declare const ENOSTR: Errno;
59
+ export declare const ENODATA: Errno;
60
+ export declare const ETIME: Errno;
61
+ export declare const ENOSR: Errno;
62
+ export declare const ENONET: Errno;
63
+ export declare const ENOPKG: Errno;
64
+ export declare const EREMOTE: Errno;
65
+ export declare const ENOLINK: Errno;
66
+ export declare const EADV: Errno;
67
+ export declare const ESRMNT: Errno;
68
+ export declare const ECOMM: Errno;
69
+ export declare const EPROTO: Errno;
70
+ export declare const EMULTIHOP: Errno;
71
+ export declare const EDOTDOT: Errno;
72
+ export declare const EBADMSG: Errno;
73
+ export declare const EOVERFLOW: Errno;
74
+ export declare const ENOTUNIQ: Errno;
75
+ export declare const EBADFD: Errno;
76
+ export declare const EREMCHG: Errno;
77
+ export declare const ELIBACC: Errno;
78
+ export declare const ELIBBAD: Errno;
79
+ export declare const ELIBSCN: Errno;
80
+ export declare const ELIBMAX: Errno;
81
+ export declare const ELIBEXEC: Errno;
82
+ export declare const EILSEQ: Errno;
83
+ export declare const EUSERS: Errno;
84
+ export declare const ENOTSOCK: Errno;
85
+ export declare const EDESTADDRREQ: Errno;
86
+ export declare const EMSGSIZE: Errno;
87
+ export declare const EPROTOTYPE: Errno;
88
+ export declare const ENOPROTOOPT: Errno;
89
+ export declare const EPROTONOSUPPORT: Errno;
90
+ export declare const ESOCKTNOSUPPORT: Errno;
91
+ export declare const EOPNOTSUPP: Errno;
92
+ export declare const EPFNOSUPPORT: Errno;
93
+ export declare const EAFNOSUPPORT: Errno;
94
+ export declare const EADDRINUSE: Errno;
95
+ export declare const EADDRNOTAVAIL: Errno;
96
+ export declare const ENETDOWN: Errno;
97
+ export declare const ENETUNREACH: Errno;
98
+ export declare const ENETRESET: Errno;
99
+ export declare const ECONNABORTED: Errno;
100
+ export declare const ECONNRESET: Errno;
101
+ export declare const ENOBUFS: Errno;
102
+ export declare const EISCONN: Errno;
103
+ export declare const ENOTCONN: Errno;
104
+ export declare const ESHUTDOWN: Errno;
105
+ export declare const ETOOMANYREFS: Errno;
106
+ export declare const ETIMEDOUT: Errno;
107
+ export declare const ECONNREFUSED: Errno;
108
+ export declare const EHOSTDOWN: Errno;
109
+ export declare const EHOSTUNREACH: Errno;
110
+ export declare const EALREADY: Errno;
111
+ export declare const EDQUOT: Errno;
@@ -0,0 +1,547 @@
1
+ export const EPERM = {
2
+ Error: () => 'operation not permitted',
3
+ Is: (target) => target === EPERM,
4
+ Errno: () => 1,
5
+ };
6
+ export const ENOENT = {
7
+ Error: () => 'no such file or directory',
8
+ Is: (target) => target === ENOENT,
9
+ Errno: () => 2,
10
+ };
11
+ export const ESRCH = {
12
+ Error: () => 'no such process',
13
+ Is: (target) => target === ESRCH,
14
+ Errno: () => 3,
15
+ };
16
+ export const EINTR = {
17
+ Error: () => 'interrupted system call',
18
+ Is: (target) => target === EINTR,
19
+ Errno: () => 4,
20
+ };
21
+ export const EIO = {
22
+ Error: () => 'I/O error',
23
+ Is: (target) => target === EIO,
24
+ Errno: () => 5,
25
+ };
26
+ export const ENXIO = {
27
+ Error: () => 'no such device or address',
28
+ Is: (target) => target === ENXIO,
29
+ Errno: () => 6,
30
+ };
31
+ export const E2BIG = {
32
+ Error: () => 'argument list too long',
33
+ Is: (target) => target === E2BIG,
34
+ Errno: () => 7,
35
+ };
36
+ export const ENOEXEC = {
37
+ Error: () => 'exec format error',
38
+ Is: (target) => target === ENOEXEC,
39
+ Errno: () => 8,
40
+ };
41
+ export const EBADF = {
42
+ Error: () => 'bad file number',
43
+ Is: (target) => target === EBADF,
44
+ Errno: () => 9,
45
+ };
46
+ export const ECHILD = {
47
+ Error: () => 'no child processes',
48
+ Is: (target) => target === ECHILD,
49
+ Errno: () => 10,
50
+ };
51
+ export const EAGAIN = {
52
+ Error: () => 'try again',
53
+ Is: (target) => target === EAGAIN,
54
+ Errno: () => 11,
55
+ };
56
+ export const ENOMEM = {
57
+ Error: () => 'out of memory',
58
+ Is: (target) => target === ENOMEM,
59
+ Errno: () => 12,
60
+ };
61
+ export const EACCES = {
62
+ Error: () => 'permission denied',
63
+ Is: (target) => target === EACCES,
64
+ Errno: () => 13,
65
+ };
66
+ export const EFAULT = {
67
+ Error: () => 'bad address',
68
+ Is: (target) => target === EFAULT,
69
+ Errno: () => 14,
70
+ };
71
+ export const EBUSY = {
72
+ Error: () => 'device or resource busy',
73
+ Is: (target) => target === EBUSY,
74
+ Errno: () => 16,
75
+ };
76
+ export const EEXIST = {
77
+ Error: () => 'file exists',
78
+ Is: (target) => target === EEXIST,
79
+ Errno: () => 17,
80
+ };
81
+ export const EXDEV = {
82
+ Error: () => 'cross-device link',
83
+ Is: (target) => target === EXDEV,
84
+ Errno: () => 18,
85
+ };
86
+ export const ENODEV = {
87
+ Error: () => 'no such device',
88
+ Is: (target) => target === ENODEV,
89
+ Errno: () => 19,
90
+ };
91
+ export const ENOTDIR = {
92
+ Error: () => 'not a directory',
93
+ Is: (target) => target === ENOTDIR,
94
+ Errno: () => 20,
95
+ };
96
+ export const EISDIR = {
97
+ Error: () => 'is a directory',
98
+ Is: (target) => target === EISDIR,
99
+ Errno: () => 21,
100
+ };
101
+ export const EINVAL = {
102
+ Error: () => 'invalid argument',
103
+ Is: (target) => target === EINVAL,
104
+ Errno: () => 22,
105
+ };
106
+ export const ENFILE = {
107
+ Error: () => 'file table overflow',
108
+ Is: (target) => target === ENFILE,
109
+ Errno: () => 23,
110
+ };
111
+ export const EMFILE = {
112
+ Error: () => 'too many open files',
113
+ Is: (target) => target === EMFILE,
114
+ Errno: () => 24,
115
+ };
116
+ export const ENOTTY = {
117
+ Error: () => 'not a typewriter',
118
+ Is: (target) => target === ENOTTY,
119
+ Errno: () => 25,
120
+ };
121
+ export const EFBIG = {
122
+ Error: () => 'file too large',
123
+ Is: (target) => target === EFBIG,
124
+ Errno: () => 27,
125
+ };
126
+ export const ENOSPC = {
127
+ Error: () => 'no space left on device',
128
+ Is: (target) => target === ENOSPC,
129
+ Errno: () => 28,
130
+ };
131
+ export const ESPIPE = {
132
+ Error: () => 'illegal seek',
133
+ Is: (target) => target === ESPIPE,
134
+ Errno: () => 29,
135
+ };
136
+ export const EROFS = {
137
+ Error: () => 'read-only file system',
138
+ Is: (target) => target === EROFS,
139
+ Errno: () => 30,
140
+ };
141
+ export const EMLINK = {
142
+ Error: () => 'too many links',
143
+ Is: (target) => target === EMLINK,
144
+ Errno: () => 31,
145
+ };
146
+ export const EPIPE = {
147
+ Error: () => 'broken pipe',
148
+ Is: (target) => target === EPIPE,
149
+ Errno: () => 32,
150
+ };
151
+ export const EDOM = {
152
+ Error: () => 'math arg out of domain of func',
153
+ Is: (target) => target === EDOM,
154
+ Errno: () => 33,
155
+ };
156
+ export const ERANGE = {
157
+ Error: () => 'result too large',
158
+ Is: (target) => target === ERANGE,
159
+ Errno: () => 34,
160
+ };
161
+ export const EDEADLK = {
162
+ Error: () => 'deadlock condition',
163
+ Is: (target) => target === EDEADLK,
164
+ Errno: () => 35,
165
+ };
166
+ export const ENAMETOOLONG = {
167
+ Error: () => 'file name too long',
168
+ Is: (target) => target === ENAMETOOLONG,
169
+ Errno: () => 36,
170
+ };
171
+ export const ENOLCK = {
172
+ Error: () => 'no record locks available',
173
+ Is: (target) => target === ENOLCK,
174
+ Errno: () => 37,
175
+ };
176
+ export const ENOSYS = {
177
+ Error: () => 'function not implemented',
178
+ Is: (target) => target === ENOSYS,
179
+ Errno: () => 38,
180
+ };
181
+ export const ENOTEMPTY = {
182
+ Error: () => 'directory not empty',
183
+ Is: (target) => target === ENOTEMPTY,
184
+ Errno: () => 39,
185
+ };
186
+ export const ELOOP = {
187
+ Error: () => 'too many symbolic links',
188
+ Is: (target) => target === ELOOP,
189
+ Errno: () => 40,
190
+ };
191
+ export const ENOMSG = {
192
+ Error: () => 'no message of desired type',
193
+ Is: (target) => target === ENOMSG,
194
+ Errno: () => 42,
195
+ };
196
+ export const EIDRM = {
197
+ Error: () => 'identifier removed',
198
+ Is: (target) => target === EIDRM,
199
+ Errno: () => 43,
200
+ };
201
+ export const ECHRNG = {
202
+ Error: () => 'channel number out of range',
203
+ Is: (target) => target === ECHRNG,
204
+ Errno: () => 44,
205
+ };
206
+ export const EL2NSYNC = {
207
+ Error: () => 'level 2 not synchronized',
208
+ Is: (target) => target === EL2NSYNC,
209
+ Errno: () => 45,
210
+ };
211
+ export const EL3HLT = {
212
+ Error: () => 'level 3 halted',
213
+ Is: (target) => target === EL3HLT,
214
+ Errno: () => 46,
215
+ };
216
+ export const EL3RST = {
217
+ Error: () => 'level 3 reset',
218
+ Is: (target) => target === EL3RST,
219
+ Errno: () => 47,
220
+ };
221
+ export const ELNRNG = {
222
+ Error: () => 'link number out of range',
223
+ Is: (target) => target === ELNRNG,
224
+ Errno: () => 48,
225
+ };
226
+ export const EUNATCH = {
227
+ Error: () => 'protocol driver not attached',
228
+ Is: (target) => target === EUNATCH,
229
+ Errno: () => 49,
230
+ };
231
+ export const ENOCSI = {
232
+ Error: () => 'no CSI structure available',
233
+ Is: (target) => target === ENOCSI,
234
+ Errno: () => 50,
235
+ };
236
+ export const EL2HLT = {
237
+ Error: () => 'level 2 halted',
238
+ Is: (target) => target === EL2HLT,
239
+ Errno: () => 51,
240
+ };
241
+ export const EBADE = {
242
+ Error: () => 'invalid exchange',
243
+ Is: (target) => target === EBADE,
244
+ Errno: () => 52,
245
+ };
246
+ export const EBADR = {
247
+ Error: () => 'invalid request descriptor',
248
+ Is: (target) => target === EBADR,
249
+ Errno: () => 53,
250
+ };
251
+ export const EXFULL = {
252
+ Error: () => 'exchange full',
253
+ Is: (target) => target === EXFULL,
254
+ Errno: () => 54,
255
+ };
256
+ export const ENOANO = {
257
+ Error: () => 'no anode',
258
+ Is: (target) => target === ENOANO,
259
+ Errno: () => 55,
260
+ };
261
+ export const EBADRQC = {
262
+ Error: () => 'invalid request code',
263
+ Is: (target) => target === EBADRQC,
264
+ Errno: () => 56,
265
+ };
266
+ export const EBADSLT = {
267
+ Error: () => 'invalid slot',
268
+ Is: (target) => target === EBADSLT,
269
+ Errno: () => 57,
270
+ };
271
+ export const EDEADLOCK = EDEADLK; // File locking deadlock error
272
+ export const EBFONT = {
273
+ Error: () => 'bad font file fmt',
274
+ Is: (target) => target === EBFONT,
275
+ Errno: () => 59,
276
+ };
277
+ export const ENOSTR = {
278
+ Error: () => 'device not a stream',
279
+ Is: (target) => target === ENOSTR,
280
+ Errno: () => 60,
281
+ };
282
+ export const ENODATA = {
283
+ Error: () => 'no data (for no delay io)',
284
+ Is: (target) => target === ENODATA,
285
+ Errno: () => 61,
286
+ };
287
+ export const ETIME = {
288
+ Error: () => 'timer expired',
289
+ Is: (target) => target === ETIME,
290
+ Errno: () => 62,
291
+ };
292
+ export const ENOSR = {
293
+ Error: () => 'out of streams resources',
294
+ Is: (target) => target === ENOSR,
295
+ Errno: () => 63,
296
+ };
297
+ export const ENONET = {
298
+ Error: () => 'machine is not on the network',
299
+ Is: (target) => target === ENONET,
300
+ Errno: () => 64,
301
+ };
302
+ export const ENOPKG = {
303
+ Error: () => 'package not installed',
304
+ Is: (target) => target === ENOPKG,
305
+ Errno: () => 65,
306
+ };
307
+ export const EREMOTE = {
308
+ Error: () => 'the object is remote',
309
+ Is: (target) => target === EREMOTE,
310
+ Errno: () => 66,
311
+ };
312
+ export const ENOLINK = {
313
+ Error: () => 'the link has been severed',
314
+ Is: (target) => target === ENOLINK,
315
+ Errno: () => 67,
316
+ };
317
+ export const EADV = {
318
+ Error: () => 'advertise error',
319
+ Is: (target) => target === EADV,
320
+ Errno: () => 68,
321
+ };
322
+ export const ESRMNT = {
323
+ Error: () => 'srmount error',
324
+ Is: (target) => target === ESRMNT,
325
+ Errno: () => 69,
326
+ };
327
+ export const ECOMM = {
328
+ Error: () => 'communication error on send',
329
+ Is: (target) => target === ECOMM,
330
+ Errno: () => 70,
331
+ };
332
+ export const EPROTO = {
333
+ Error: () => 'protocol error',
334
+ Is: (target) => target === EPROTO,
335
+ Errno: () => 71,
336
+ };
337
+ export const EMULTIHOP = {
338
+ Error: () => 'multihop attempted',
339
+ Is: (target) => target === EMULTIHOP,
340
+ Errno: () => 72,
341
+ };
342
+ export const EDOTDOT = {
343
+ Error: () => 'cross mount point (not really error)',
344
+ Is: (target) => target === EDOTDOT,
345
+ Errno: () => 73,
346
+ };
347
+ export const EBADMSG = {
348
+ Error: () => 'trying to read unreadable message',
349
+ Is: (target) => target === EBADMSG,
350
+ Errno: () => 74,
351
+ };
352
+ export const EOVERFLOW = {
353
+ Error: () => 'value too large for defined data type',
354
+ Is: (target) => target === EOVERFLOW,
355
+ Errno: () => 75,
356
+ };
357
+ export const ENOTUNIQ = {
358
+ Error: () => 'given log. name not unique',
359
+ Is: (target) => target === ENOTUNIQ,
360
+ Errno: () => 76,
361
+ };
362
+ export const EBADFD = {
363
+ Error: () => 'f.d. invalid for this operation',
364
+ Is: (target) => target === EBADFD,
365
+ Errno: () => 77,
366
+ };
367
+ export const EREMCHG = {
368
+ Error: () => 'remote address changed',
369
+ Is: (target) => target === EREMCHG,
370
+ Errno: () => 78,
371
+ };
372
+ export const ELIBACC = {
373
+ Error: () => "can't access a needed shared lib",
374
+ Is: (target) => target === ELIBACC,
375
+ Errno: () => 79,
376
+ };
377
+ export const ELIBBAD = {
378
+ Error: () => 'accessing a corrupted shared lib',
379
+ Is: (target) => target === ELIBBAD,
380
+ Errno: () => 80,
381
+ };
382
+ export const ELIBSCN = {
383
+ Error: () => '.lib section in a.out corrupted',
384
+ Is: (target) => target === ELIBSCN,
385
+ Errno: () => 81,
386
+ };
387
+ export const ELIBMAX = {
388
+ Error: () => 'attempting to link in too many libs',
389
+ Is: (target) => target === ELIBMAX,
390
+ Errno: () => 82,
391
+ };
392
+ export const ELIBEXEC = {
393
+ Error: () => 'attempting to exec a shared library',
394
+ Is: (target) => target === ELIBEXEC,
395
+ Errno: () => 83,
396
+ };
397
+ export const EILSEQ = {
398
+ Error: () => 'illegal byte sequence',
399
+ Is: (target) => target === EILSEQ,
400
+ Errno: () => 84,
401
+ };
402
+ export const EUSERS = {
403
+ Error: () => 'too many users',
404
+ Is: (target) => target === EUSERS,
405
+ Errno: () => 87,
406
+ };
407
+ export const ENOTSOCK = {
408
+ Error: () => 'socket operation on non-socket',
409
+ Is: (target) => target === ENOTSOCK,
410
+ Errno: () => 88,
411
+ };
412
+ export const EDESTADDRREQ = {
413
+ Error: () => 'destination address required',
414
+ Is: (target) => target === EDESTADDRREQ,
415
+ Errno: () => 89,
416
+ };
417
+ export const EMSGSIZE = {
418
+ Error: () => 'message too long',
419
+ Is: (target) => target === EMSGSIZE,
420
+ Errno: () => 90,
421
+ };
422
+ export const EPROTOTYPE = {
423
+ Error: () => 'protocol wrong type for socket',
424
+ Is: (target) => target === EPROTOTYPE,
425
+ Errno: () => 91,
426
+ };
427
+ export const ENOPROTOOPT = {
428
+ Error: () => 'protocol not available',
429
+ Is: (target) => target === ENOPROTOOPT,
430
+ Errno: () => 92,
431
+ };
432
+ export const EPROTONOSUPPORT = {
433
+ Error: () => 'unknown protocol',
434
+ Is: (target) => target === EPROTONOSUPPORT,
435
+ Errno: () => 93,
436
+ };
437
+ export const ESOCKTNOSUPPORT = {
438
+ Error: () => 'socket type not supported',
439
+ Is: (target) => target === ESOCKTNOSUPPORT,
440
+ Errno: () => 94,
441
+ };
442
+ export const EOPNOTSUPP = {
443
+ Error: () => 'operation not supported on transport endpoint',
444
+ Is: (target) => target === EOPNOTSUPP,
445
+ Errno: () => 95,
446
+ };
447
+ export const EPFNOSUPPORT = {
448
+ Error: () => 'protocol family not supported',
449
+ Is: (target) => target === EPFNOSUPPORT,
450
+ Errno: () => 96,
451
+ };
452
+ export const EAFNOSUPPORT = {
453
+ Error: () => 'address family not supported by protocol family',
454
+ Is: (target) => target === EAFNOSUPPORT,
455
+ Errno: () => 97,
456
+ };
457
+ export const EADDRINUSE = {
458
+ Error: () => 'address already in use',
459
+ Is: (target) => target === EADDRINUSE,
460
+ Errno: () => 98,
461
+ };
462
+ export const EADDRNOTAVAIL = {
463
+ Error: () => 'address not available',
464
+ Is: (target) => target === EADDRNOTAVAIL,
465
+ Errno: () => 99,
466
+ };
467
+ export const ENETDOWN = {
468
+ Error: () => 'network interface is not configured',
469
+ Is: (target) => target === ENETDOWN,
470
+ Errno: () => 100,
471
+ };
472
+ export const ENETUNREACH = {
473
+ Error: () => 'network is unreachable',
474
+ Is: (target) => target === ENETUNREACH,
475
+ Errno: () => 101,
476
+ };
477
+ export const ENETRESET = {
478
+ Error: () => 'network dropped connection because of reset',
479
+ Is: (target) => target === ENETRESET,
480
+ Errno: () => 102,
481
+ };
482
+ export const ECONNABORTED = {
483
+ Error: () => 'connection aborted',
484
+ Is: (target) => target === ECONNABORTED,
485
+ Errno: () => 103,
486
+ };
487
+ export const ECONNRESET = {
488
+ Error: () => 'connection reset by peer',
489
+ Is: (target) => target === ECONNRESET,
490
+ Errno: () => 104,
491
+ };
492
+ export const ENOBUFS = {
493
+ Error: () => 'no buffer space available',
494
+ Is: (target) => target === ENOBUFS,
495
+ Errno: () => 105,
496
+ };
497
+ export const EISCONN = {
498
+ Error: () => 'socket is already connected',
499
+ Is: (target) => target === EISCONN,
500
+ Errno: () => 106,
501
+ };
502
+ export const ENOTCONN = {
503
+ Error: () => 'socket is not connected',
504
+ Is: (target) => target === ENOTCONN,
505
+ Errno: () => 107,
506
+ };
507
+ export const ESHUTDOWN = {
508
+ Error: () => "can't send after socket shutdown",
509
+ Is: (target) => target === ESHUTDOWN,
510
+ Errno: () => 108,
511
+ };
512
+ export const ETOOMANYREFS = {
513
+ Error: () => 'too many references: cannot splice',
514
+ Is: (target) => target === ETOOMANYREFS,
515
+ Errno: () => 109,
516
+ };
517
+ export const ETIMEDOUT = {
518
+ Error: () => 'connection timed out',
519
+ Is: (target) => target === ETIMEDOUT,
520
+ Errno: () => 110,
521
+ };
522
+ export const ECONNREFUSED = {
523
+ Error: () => 'connection refused',
524
+ Is: (target) => target === ECONNREFUSED,
525
+ Errno: () => 111,
526
+ };
527
+ export const EHOSTDOWN = {
528
+ Error: () => 'host is down',
529
+ Is: (target) => target === EHOSTDOWN,
530
+ Errno: () => 112,
531
+ };
532
+ export const EHOSTUNREACH = {
533
+ Error: () => 'host is unreachable',
534
+ Is: (target) => target === EHOSTUNREACH,
535
+ Errno: () => 113,
536
+ };
537
+ export const EALREADY = {
538
+ Error: () => 'socket already connected',
539
+ Is: (target) => target === EALREADY,
540
+ Errno: () => 114,
541
+ };
542
+ export const EDQUOT = {
543
+ Error: () => 'quota exceeded',
544
+ Is: (target) => target === EDQUOT,
545
+ Errno: () => 122,
546
+ };
547
+ //# sourceMappingURL=errors.js.map