goscript 0.0.35 → 0.0.37
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.
- package/compiler/expr-call.go +26 -0
- package/compiler/spec-struct.go +41 -8
- package/compiler/spec-value.go +4 -0
- package/compiler/spec.go +1 -1
- package/compiler/stmt.go +26 -8
- package/dist/gs/internal/byteorder/index.d.ts +8 -0
- package/dist/gs/internal/byteorder/index.js +34 -0
- package/dist/gs/internal/byteorder/index.js.map +1 -0
- package/dist/gs/internal/testlog/index.d.ts +1 -0
- package/dist/gs/internal/testlog/index.js +5 -0
- package/dist/gs/internal/testlog/index.js.map +1 -0
- package/dist/gs/maps/iter.d.ts +1 -1
- package/dist/gs/os/dir.gs.d.ts +6 -0
- package/dist/gs/os/dir.gs.js +35 -0
- package/dist/gs/os/dir.gs.js.map +1 -0
- package/dist/gs/os/dir_unix.gs.d.ts +7 -0
- package/dist/gs/os/dir_unix.gs.js +113 -0
- package/dist/gs/os/dir_unix.gs.js.map +1 -0
- package/dist/gs/os/dirent_js.gs.d.ts +5 -0
- package/dist/gs/os/dirent_js.gs.js +20 -0
- package/dist/gs/os/dirent_js.gs.js.map +1 -0
- package/dist/gs/os/env.gs.d.ts +12 -0
- package/dist/gs/os/env.gs.js +157 -0
- package/dist/gs/os/env.gs.js.map +1 -0
- package/dist/gs/os/error.gs.d.ts +40 -0
- package/dist/gs/os/error.gs.js +158 -0
- package/dist/gs/os/error.gs.js.map +1 -0
- package/dist/gs/os/error_errno.gs.d.ts +1 -0
- package/dist/gs/os/error_errno.gs.js +5 -0
- package/dist/gs/os/error_errno.gs.js.map +1 -0
- package/dist/gs/os/exec.gs.d.ts +60 -0
- package/dist/gs/os/exec.gs.js +136 -0
- package/dist/gs/os/exec.gs.js.map +1 -0
- package/dist/gs/os/exec_nohandle.gs.d.ts +1 -0
- package/dist/gs/os/exec_nohandle.gs.js +2 -0
- package/dist/gs/os/exec_nohandle.gs.js.map +1 -0
- package/dist/gs/os/exec_posix.gs.d.ts +25 -0
- package/dist/gs/os/exec_posix.gs.js +67 -0
- package/dist/gs/os/exec_posix.gs.js.map +1 -0
- package/dist/gs/os/exec_unix.gs.d.ts +4 -0
- package/dist/gs/os/exec_unix.gs.js +46 -0
- package/dist/gs/os/exec_unix.gs.js.map +1 -0
- package/dist/gs/os/executable.gs.d.ts +2 -0
- package/dist/gs/os/executable.gs.js +16 -0
- package/dist/gs/os/executable.gs.js.map +1 -0
- package/dist/gs/os/executable_js.gs.d.ts +2 -0
- package/dist/gs/os/executable_js.gs.js +5 -0
- package/dist/gs/os/executable_js.gs.js.map +1 -0
- package/dist/gs/os/executable_wasm.gs.d.ts +2 -0
- package/dist/gs/os/executable_wasm.gs.js +6 -0
- package/dist/gs/os/executable_wasm.gs.js.map +1 -0
- package/dist/gs/os/file_constants_js.gs.d.ts +41 -0
- package/dist/gs/os/file_constants_js.gs.js +78 -0
- package/dist/gs/os/file_constants_js.gs.js.map +1 -0
- package/dist/gs/os/file_js.gs.d.ts +22 -0
- package/dist/gs/os/file_js.gs.js +73 -0
- package/dist/gs/os/file_js.gs.js.map +1 -0
- package/dist/gs/os/file_open_unix.gs.d.ts +6 -0
- package/dist/gs/os/file_open_unix.gs.js +10 -0
- package/dist/gs/os/file_open_unix.gs.js.map +1 -0
- package/dist/gs/os/file_posix_js.gs.d.ts +8 -0
- package/dist/gs/os/file_posix_js.gs.js +32 -0
- package/dist/gs/os/file_posix_js.gs.js.map +1 -0
- package/dist/gs/os/file_unix_js.gs.d.ts +27 -0
- package/dist/gs/os/file_unix_js.gs.js +64 -0
- package/dist/gs/os/file_unix_js.gs.js.map +1 -0
- package/dist/gs/os/getwd_js.gs.d.ts +6 -0
- package/dist/gs/os/getwd_js.gs.js +21 -0
- package/dist/gs/os/getwd_js.gs.js.map +1 -0
- package/dist/gs/os/index.d.ts +19 -0
- package/dist/gs/os/index.js +20 -0
- package/dist/gs/os/index.js.map +1 -0
- package/dist/gs/os/path.gs.d.ts +4 -0
- package/dist/gs/os/path.gs.js +32 -0
- package/dist/gs/os/path.gs.js.map +1 -0
- package/dist/gs/os/path_unix.gs.d.ts +4 -0
- package/dist/gs/os/path_unix.gs.js +40 -0
- package/dist/gs/os/path_unix.gs.js.map +1 -0
- package/dist/gs/os/pidfd_js.gs.d.ts +6 -0
- package/dist/gs/os/pidfd_js.gs.js +14 -0
- package/dist/gs/os/pidfd_js.gs.js.map +1 -0
- package/dist/gs/os/pipe_wasm.gs.d.ts +2 -0
- package/dist/gs/os/pipe_wasm.gs.js +14 -0
- package/dist/gs/os/pipe_wasm.gs.js.map +1 -0
- package/dist/gs/os/proc.gs.d.ts +11 -0
- package/dist/gs/os/proc.gs.js +68 -0
- package/dist/gs/os/proc.gs.js.map +1 -0
- package/dist/gs/os/proc_js.gs.d.ts +3 -0
- package/dist/gs/os/proc_js.gs.js +12 -0
- package/dist/gs/os/proc_js.gs.js.map +1 -0
- package/dist/gs/os/rawconn_js.gs.d.ts +10 -0
- package/dist/gs/os/rawconn_js.gs.js +26 -0
- package/dist/gs/os/rawconn_js.gs.js.map +1 -0
- package/dist/gs/os/removeall_js.gs.d.ts +2 -0
- package/dist/gs/os/removeall_js.gs.js +7 -0
- package/dist/gs/os/removeall_js.gs.js.map +1 -0
- package/dist/gs/os/root_js.gs.d.ts +23 -0
- package/dist/gs/os/root_js.gs.js +80 -0
- package/dist/gs/os/root_js.gs.js.map +1 -0
- package/dist/gs/os/root_nonwindows.gs.d.ts +2 -0
- package/dist/gs/os/root_nonwindows.gs.js +4 -0
- package/dist/gs/os/root_nonwindows.gs.js.map +1 -0
- package/dist/gs/os/root_noopenat.gs.d.ts +11 -0
- package/dist/gs/os/root_noopenat.gs.js +31 -0
- package/dist/gs/os/root_noopenat.gs.js.map +1 -0
- package/dist/gs/os/stat.gs.d.ts +24 -0
- package/dist/gs/os/stat.gs.js +20 -0
- package/dist/gs/os/stat.gs.js.map +1 -0
- package/dist/gs/os/stat_js.gs.d.ts +6 -0
- package/dist/gs/os/stat_js.gs.js +23 -0
- package/dist/gs/os/stat_js.gs.js.map +1 -0
- package/dist/gs/os/stat_unix_js.gs.d.ts +8 -0
- package/dist/gs/os/stat_unix_js.gs.js +16 -0
- package/dist/gs/os/stat_unix_js.gs.js.map +1 -0
- package/dist/gs/os/sticky_bsd.gs.d.ts +1 -0
- package/dist/gs/os/sticky_bsd.gs.js +3 -0
- package/dist/gs/os/sticky_bsd.gs.js.map +1 -0
- package/dist/gs/os/sys.gs.d.ts +2 -0
- package/dist/gs/os/sys.gs.js +10 -0
- package/dist/gs/os/sys.gs.js.map +1 -0
- package/dist/gs/os/sys_bsd.gs.d.ts +2 -0
- package/dist/gs/os/sys_bsd.gs.js +15 -0
- package/dist/gs/os/sys_bsd.gs.js.map +1 -0
- package/dist/gs/os/sys_js.gs.d.ts +2 -0
- package/dist/gs/os/sys_js.gs.js +6 -0
- package/dist/gs/os/sys_js.gs.js.map +1 -0
- package/dist/gs/os/tempfile.gs.d.ts +5 -0
- package/dist/gs/os/tempfile.gs.js +30 -0
- package/dist/gs/os/tempfile.gs.js.map +1 -0
- package/dist/gs/os/types.gs.d.ts +59 -0
- package/dist/gs/os/types.gs.js +123 -0
- package/dist/gs/os/types.gs.js.map +1 -0
- package/dist/gs/os/types_js.gs.d.ts +74 -0
- package/dist/gs/os/types_js.gs.js +147 -0
- package/dist/gs/os/types_js.gs.js.map +1 -0
- package/dist/gs/os/types_unix.gs.d.ts +40 -0
- package/dist/gs/os/types_unix.gs.js +87 -0
- package/dist/gs/os/types_unix.gs.js.map +1 -0
- package/dist/gs/os/wait_unimp.gs.d.ts +1 -0
- package/dist/gs/os/wait_unimp.gs.js +2 -0
- package/dist/gs/os/wait_unimp.gs.js.map +1 -0
- package/dist/gs/os/zero_copy_posix.gs.d.ts +4 -0
- package/dist/gs/os/zero_copy_posix.gs.js +27 -0
- package/dist/gs/os/zero_copy_posix.gs.js.map +1 -0
- package/dist/gs/os/zero_copy_stub.gs.d.ts +1 -0
- package/dist/gs/os/zero_copy_stub.gs.js +2 -0
- package/dist/gs/os/zero_copy_stub.gs.js.map +1 -0
- package/dist/gs/sync/atomic/doc.gs.d.ts +28 -0
- package/dist/gs/sync/atomic/doc.gs.js +265 -0
- package/dist/gs/sync/atomic/doc.gs.js.map +1 -0
- package/dist/gs/sync/atomic/doc_64.gs.d.ts +15 -0
- package/dist/gs/sync/atomic/doc_64.gs.js +165 -0
- package/dist/gs/sync/atomic/doc_64.gs.js.map +1 -0
- package/dist/gs/sync/atomic/index.d.ts +4 -0
- package/dist/gs/sync/atomic/index.js +5 -0
- package/dist/gs/sync/atomic/index.js.map +1 -0
- package/dist/gs/sync/atomic/type.gs.d.ts +130 -0
- package/dist/gs/sync/atomic/type.gs.js +433 -0
- package/dist/gs/sync/atomic/type.gs.js.map +1 -0
- package/dist/gs/sync/atomic/value.gs.d.ts +19 -0
- package/dist/gs/sync/atomic/value.gs.js +116 -0
- package/dist/gs/sync/atomic/value.gs.js.map +1 -0
- package/dist/gs/syscall/index.d.ts +80 -0
- package/dist/gs/syscall/index.js +163 -0
- package/dist/gs/syscall/index.js.map +1 -0
- package/dist/gs/unsafe/unsafe.d.ts +1 -0
- package/dist/gs/unsafe/unsafe.js +5 -0
- package/dist/gs/unsafe/unsafe.js.map +1 -1
- package/gs/internal/byteorder/index.ts +40 -0
- package/gs/internal/testlog/index.ts +7 -0
- package/gs/maps/iter.ts +1 -1
- package/gs/math/erfinv.gs.test.ts +2 -2
- package/gs/math/fma.gs.test.ts +5 -5
- package/gs/math/ldexp.gs.test.ts +5 -5
- package/gs/math/lgamma.gs.test.ts +2 -2
- package/gs/os/dir.gs.ts +42 -0
- package/gs/os/dir_unix.gs.ts +155 -0
- package/gs/os/dirent_js.gs.ts +27 -0
- package/gs/os/env.gs.ts +179 -0
- package/gs/os/error.gs.ts +205 -0
- package/gs/os/error_errno.gs.ts +12 -0
- package/gs/os/exec.gs.ts +198 -0
- package/gs/os/exec_nohandle.gs.ts +2 -0
- package/gs/os/exec_posix.gs.ts +95 -0
- package/gs/os/exec_unix.gs.ts +64 -0
- package/gs/os/executable.gs.ts +18 -0
- package/gs/os/executable_js.gs.ts +6 -0
- package/gs/os/executable_wasm.gs.ts +10 -0
- package/gs/os/file_constants_js.gs.ts +98 -0
- package/gs/os/file_js.gs.ts +99 -0
- package/gs/os/file_open_unix.gs.ts +15 -0
- package/gs/os/file_posix_js.gs.ts +40 -0
- package/gs/os/file_unix_js.gs.ts +94 -0
- package/gs/os/getwd_js.gs.ts +28 -0
- package/gs/os/index.ts +19 -0
- package/gs/os/path.gs.ts +35 -0
- package/gs/os/path_unix.gs.ts +49 -0
- package/gs/os/pidfd_js.gs.ts +25 -0
- package/gs/os/pipe_wasm.gs.ts +17 -0
- package/gs/os/proc.gs.ts +84 -0
- package/gs/os/proc_js.gs.ts +15 -0
- package/gs/os/rawconn_js.gs.ts +30 -0
- package/gs/os/removeall_js.gs.ts +9 -0
- package/gs/os/root_js.gs.ts +111 -0
- package/gs/os/root_nonwindows.gs.ts +6 -0
- package/gs/os/root_noopenat.gs.ts +45 -0
- package/gs/os/stat.gs.ts +38 -0
- package/gs/os/stat_js.gs.ts +30 -0
- package/gs/os/stat_unix_js.gs.ts +27 -0
- package/gs/os/sticky_bsd.gs.ts +4 -0
- package/gs/os/sys.gs.ts +12 -0
- package/gs/os/sys_bsd.gs.ts +17 -0
- package/gs/os/sys_js.gs.ts +9 -0
- package/gs/os/tempfile.gs.ts +34 -0
- package/gs/os/types.gs.ts +170 -0
- package/gs/os/types_js.gs.ts +205 -0
- package/gs/os/types_unix.gs.ts +118 -0
- package/gs/os/wait_unimp.gs.ts +2 -0
- package/gs/os/zero_copy_posix.gs.ts +35 -0
- package/gs/os/zero_copy_stub.gs.ts +4 -0
- package/gs/sync/atomic/doc.gs.ts +276 -0
- package/gs/sync/atomic/doc_64.gs.ts +168 -0
- package/gs/sync/atomic/index.ts +4 -0
- package/gs/sync/atomic/type.gs.ts +596 -0
- package/gs/sync/atomic/value.gs.ts +158 -0
- package/gs/syscall/index.ts +204 -0
- package/gs/unsafe/unsafe.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as $ from "@goscript/builtin/builtin.js";
|
|
2
|
+
// firstStoreInProgress is a placeholder value used during the first store operation
|
|
3
|
+
const firstStoreInProgress = Symbol('firstStoreInProgress');
|
|
4
|
+
export class Value {
|
|
5
|
+
get v() {
|
|
6
|
+
return this._fields.v.value;
|
|
7
|
+
}
|
|
8
|
+
set v(value) {
|
|
9
|
+
this._fields.v.value = value;
|
|
10
|
+
}
|
|
11
|
+
_fields;
|
|
12
|
+
constructor(init) {
|
|
13
|
+
this._fields = {
|
|
14
|
+
v: $.varRef(init?.v ?? null)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
clone() {
|
|
18
|
+
const cloned = new Value();
|
|
19
|
+
cloned._fields = {
|
|
20
|
+
v: $.varRef(this._fields.v.value)
|
|
21
|
+
};
|
|
22
|
+
return cloned;
|
|
23
|
+
}
|
|
24
|
+
// Load returns the value set by the most recent Store.
|
|
25
|
+
// It returns nil if there has been no call to Store for this Value.
|
|
26
|
+
Load() {
|
|
27
|
+
const v = this;
|
|
28
|
+
// For JavaScript, we can simplify this since we're single-threaded
|
|
29
|
+
// Just return the stored value directly
|
|
30
|
+
return v._fields.v.value;
|
|
31
|
+
}
|
|
32
|
+
// Store sets the value of the [Value] v to val.
|
|
33
|
+
// All calls to Store for a given Value must use values of the same concrete type.
|
|
34
|
+
// Store of an inconsistent type panics, as does Store(nil).
|
|
35
|
+
Store(val) {
|
|
36
|
+
const v = this;
|
|
37
|
+
if (val == null) {
|
|
38
|
+
$.panic("sync/atomic: store of nil value into Value");
|
|
39
|
+
}
|
|
40
|
+
// For JavaScript, store the value directly
|
|
41
|
+
v._fields.v.value = val;
|
|
42
|
+
}
|
|
43
|
+
// Swap stores new into Value and returns the previous value. It returns nil if
|
|
44
|
+
// the Value is empty.
|
|
45
|
+
//
|
|
46
|
+
// All calls to Swap for a given Value must use values of the same concrete
|
|
47
|
+
// type. Swap of an inconsistent type panics, as does Swap(nil).
|
|
48
|
+
Swap(_new) {
|
|
49
|
+
const v = this;
|
|
50
|
+
if (_new == null) {
|
|
51
|
+
$.panic("sync/atomic: swap of nil value into Value");
|
|
52
|
+
}
|
|
53
|
+
// For JavaScript, swap the values directly
|
|
54
|
+
const old = v._fields.v.value;
|
|
55
|
+
v._fields.v.value = _new;
|
|
56
|
+
return old;
|
|
57
|
+
}
|
|
58
|
+
// CompareAndSwap executes the compare-and-swap operation for the [Value].
|
|
59
|
+
//
|
|
60
|
+
// All calls to CompareAndSwap for a given Value must use values of the same
|
|
61
|
+
// concrete type. CompareAndSwap of an inconsistent type panics, as does
|
|
62
|
+
// CompareAndSwap(old, nil).
|
|
63
|
+
CompareAndSwap(old, _new) {
|
|
64
|
+
const v = this;
|
|
65
|
+
if (_new == null) {
|
|
66
|
+
$.panic("sync/atomic: compare and swap of nil value into Value");
|
|
67
|
+
}
|
|
68
|
+
// For JavaScript, compare and swap directly
|
|
69
|
+
if (v._fields.v.value === old) {
|
|
70
|
+
v._fields.v.value = _new;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
// Register this type with the runtime type system
|
|
76
|
+
static __typeInfo = $.registerStructType('Value', new Value(), [{ name: "Load", args: [], returns: [{ type: { kind: $.TypeKind.Interface, methods: [] } }] }, { name: "Store", args: [{ name: "val", type: { kind: $.TypeKind.Interface, methods: [] } }], returns: [] }, { name: "Swap", args: [{ name: "new", type: { kind: $.TypeKind.Interface, methods: [] } }], returns: [{ type: { kind: $.TypeKind.Interface, methods: [] } }] }, { name: "CompareAndSwap", args: [{ name: "old", type: { kind: $.TypeKind.Interface, methods: [] } }, { name: "new", type: { kind: $.TypeKind.Interface, methods: [] } }], returns: [{ type: { kind: $.TypeKind.Basic, name: "boolean" } }] }], Value, { "v": { kind: $.TypeKind.Interface, methods: [] } });
|
|
77
|
+
}
|
|
78
|
+
class efaceWords {
|
|
79
|
+
get typ() {
|
|
80
|
+
return this._fields.typ.value;
|
|
81
|
+
}
|
|
82
|
+
set typ(value) {
|
|
83
|
+
this._fields.typ.value = value;
|
|
84
|
+
}
|
|
85
|
+
get data() {
|
|
86
|
+
return this._fields.data.value;
|
|
87
|
+
}
|
|
88
|
+
set data(value) {
|
|
89
|
+
this._fields.data.value = value;
|
|
90
|
+
}
|
|
91
|
+
_fields;
|
|
92
|
+
constructor(init) {
|
|
93
|
+
this._fields = {
|
|
94
|
+
typ: $.varRef(init?.typ ?? null),
|
|
95
|
+
data: $.varRef(init?.data ?? null)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
clone() {
|
|
99
|
+
const cloned = new efaceWords();
|
|
100
|
+
cloned._fields = {
|
|
101
|
+
typ: $.varRef(this._fields.typ.value),
|
|
102
|
+
data: $.varRef(this._fields.data.value)
|
|
103
|
+
};
|
|
104
|
+
return cloned;
|
|
105
|
+
}
|
|
106
|
+
// Register this type with the runtime type system
|
|
107
|
+
static __typeInfo = $.registerStructType('efaceWords', new efaceWords(), [], efaceWords, { "data": { kind: $.TypeKind.Basic, name: "Pointer" }, "typ": { kind: $.TypeKind.Basic, name: "Pointer" } });
|
|
108
|
+
}
|
|
109
|
+
// Runtime functions for pinning/unpinning (no-ops in JavaScript)
|
|
110
|
+
export function runtime_procPin() {
|
|
111
|
+
return 0; // No-op in JavaScript
|
|
112
|
+
}
|
|
113
|
+
export function runtime_procUnpin() {
|
|
114
|
+
// No-op in JavaScript
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=value.gs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.gs.js","sourceRoot":"","sources":["../../../../gs/sync/atomic/value.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAQlD,oFAAoF;AACpF,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBA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@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as $ from "@goscript/builtin/builtin.js";
|
|
2
|
+
export type uintptr = number;
|
|
3
|
+
export interface Errno {
|
|
4
|
+
Error(): string;
|
|
5
|
+
Is(target: $.GoError): boolean;
|
|
6
|
+
Errno(): number;
|
|
7
|
+
}
|
|
8
|
+
export declare const O_RDONLY = 0;
|
|
9
|
+
export declare const O_WRONLY = 1;
|
|
10
|
+
export declare const O_RDWR = 2;
|
|
11
|
+
export declare const O_APPEND = 8;
|
|
12
|
+
export declare const O_CREATE = 64;
|
|
13
|
+
export declare const O_EXCL = 128;
|
|
14
|
+
export declare const O_SYNC = 256;
|
|
15
|
+
export declare const O_TRUNC = 512;
|
|
16
|
+
export declare const Stdin = 0;
|
|
17
|
+
export declare const Stdout = 1;
|
|
18
|
+
export declare const Stderr = 2;
|
|
19
|
+
export declare const SIGINT = 2;
|
|
20
|
+
export declare const SIGTERM = 15;
|
|
21
|
+
export declare const S_IFMT = 61440;
|
|
22
|
+
export declare const S_IFREG = 32768;
|
|
23
|
+
export declare const S_IFDIR = 16384;
|
|
24
|
+
export declare const S_IFLNK = 40960;
|
|
25
|
+
export declare const S_IFBLK = 24576;
|
|
26
|
+
export declare const S_IFCHR = 8192;
|
|
27
|
+
export declare const S_IFIFO = 4096;
|
|
28
|
+
export declare const S_IFSOCK = 49152;
|
|
29
|
+
export declare const S_ISUID = 2048;
|
|
30
|
+
export declare const S_ISGID = 1024;
|
|
31
|
+
export declare const S_ISVTX = 512;
|
|
32
|
+
export declare function Getenv(key: string): [string, boolean];
|
|
33
|
+
export declare function Setenv(key: string, value: string): $.GoError;
|
|
34
|
+
export declare function Unsetenv(key: string): $.GoError;
|
|
35
|
+
export declare function Clearenv(): void;
|
|
36
|
+
export declare function Environ(): $.Slice<string>;
|
|
37
|
+
export declare class Dirent {
|
|
38
|
+
Name: $.Bytes;
|
|
39
|
+
Reclen: number;
|
|
40
|
+
constructor(init?: any);
|
|
41
|
+
}
|
|
42
|
+
export declare class Stat_t {
|
|
43
|
+
Dev: number;
|
|
44
|
+
Ino: number;
|
|
45
|
+
Mode: number;
|
|
46
|
+
Nlink: number;
|
|
47
|
+
Uid: number;
|
|
48
|
+
Gid: number;
|
|
49
|
+
Rdev: number;
|
|
50
|
+
Size: number;
|
|
51
|
+
Blksize: number;
|
|
52
|
+
Blocks: number;
|
|
53
|
+
Atime: number;
|
|
54
|
+
Mtime: number;
|
|
55
|
+
Ctime: number;
|
|
56
|
+
AtimeNsec: number;
|
|
57
|
+
MtimeNsec: number;
|
|
58
|
+
CtimeNsec: number;
|
|
59
|
+
constructor(init?: any);
|
|
60
|
+
clone(): Stat_t;
|
|
61
|
+
}
|
|
62
|
+
export interface RawConn {
|
|
63
|
+
Control(f: (fd: uintptr) => void): $.GoError;
|
|
64
|
+
Read(f: (fd: uintptr) => boolean): $.GoError;
|
|
65
|
+
Write(f: (fd: uintptr) => boolean): $.GoError;
|
|
66
|
+
}
|
|
67
|
+
export declare class StubRawConn implements RawConn {
|
|
68
|
+
Control(f: (fd: uintptr) => void): $.GoError;
|
|
69
|
+
Read(f: (fd: uintptr) => boolean): $.GoError;
|
|
70
|
+
Write(f: (fd: uintptr) => boolean): $.GoError;
|
|
71
|
+
}
|
|
72
|
+
export declare const ENOSYS: Errno;
|
|
73
|
+
export declare const EISDIR: Errno;
|
|
74
|
+
export declare const ENOTDIR: Errno;
|
|
75
|
+
export declare const ERANGE: Errno;
|
|
76
|
+
export declare const ENOMEM: Errno;
|
|
77
|
+
export declare const ESRCH: Errno;
|
|
78
|
+
export declare function Open(path: string, flag: number, perm: number): [number, $.GoError];
|
|
79
|
+
export declare function Sysctl(name: string): [string, $.GoError];
|
|
80
|
+
export declare function Getpagesize(): number;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as $ from "@goscript/builtin/builtin.js";
|
|
2
|
+
// Essential syscall constants
|
|
3
|
+
export const O_RDONLY = 0;
|
|
4
|
+
export const O_WRONLY = 1;
|
|
5
|
+
export const O_RDWR = 2;
|
|
6
|
+
export const O_APPEND = 8;
|
|
7
|
+
export const O_CREATE = 64;
|
|
8
|
+
export const O_EXCL = 128;
|
|
9
|
+
export const O_SYNC = 256;
|
|
10
|
+
export const O_TRUNC = 512;
|
|
11
|
+
export const Stdin = 0;
|
|
12
|
+
export const Stdout = 1;
|
|
13
|
+
export const Stderr = 2;
|
|
14
|
+
export const SIGINT = 2;
|
|
15
|
+
export const SIGTERM = 15;
|
|
16
|
+
// File mode constants
|
|
17
|
+
export const S_IFMT = 0o170000;
|
|
18
|
+
export const S_IFREG = 0o100000;
|
|
19
|
+
export const S_IFDIR = 0o040000;
|
|
20
|
+
export const S_IFLNK = 0o120000;
|
|
21
|
+
export const S_IFBLK = 0o060000;
|
|
22
|
+
export const S_IFCHR = 0o020000;
|
|
23
|
+
export const S_IFIFO = 0o010000;
|
|
24
|
+
export const S_IFSOCK = 0o140000;
|
|
25
|
+
export const S_ISUID = 0o004000;
|
|
26
|
+
export const S_ISGID = 0o002000;
|
|
27
|
+
export const S_ISVTX = 0o001000;
|
|
28
|
+
// Environment variable functions using Node.js/browser APIs
|
|
29
|
+
export function Getenv(key) {
|
|
30
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
31
|
+
const value = process.env[key];
|
|
32
|
+
return value !== undefined ? [value, true] : ["", false];
|
|
33
|
+
}
|
|
34
|
+
return ["", false];
|
|
35
|
+
}
|
|
36
|
+
export function Setenv(key, value) {
|
|
37
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
38
|
+
process.env[key] = value;
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return { Error: () => "setenv not supported" };
|
|
42
|
+
}
|
|
43
|
+
export function Unsetenv(key) {
|
|
44
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
45
|
+
delete process.env[key];
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return { Error: () => "unsetenv not supported" };
|
|
49
|
+
}
|
|
50
|
+
export function Clearenv() {
|
|
51
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
52
|
+
for (const key in process.env) {
|
|
53
|
+
delete process.env[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function Environ() {
|
|
58
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
59
|
+
const env = [];
|
|
60
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
61
|
+
if (value !== undefined) {
|
|
62
|
+
env.push(`${key}=${value}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return $.arrayToSlice(env);
|
|
66
|
+
}
|
|
67
|
+
return $.arrayToSlice([]);
|
|
68
|
+
}
|
|
69
|
+
// Dirent structure with Reclen field
|
|
70
|
+
export class Dirent {
|
|
71
|
+
Name = new Uint8Array(0);
|
|
72
|
+
Reclen = 0;
|
|
73
|
+
constructor(init) {
|
|
74
|
+
if (init?.Name)
|
|
75
|
+
this.Name = init.Name;
|
|
76
|
+
if (init?.Reclen)
|
|
77
|
+
this.Reclen = init.Reclen;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Stat_t structure stub
|
|
81
|
+
export class Stat_t {
|
|
82
|
+
Dev = 0;
|
|
83
|
+
Ino = 0;
|
|
84
|
+
Mode = 0;
|
|
85
|
+
Nlink = 0;
|
|
86
|
+
Uid = 0;
|
|
87
|
+
Gid = 0;
|
|
88
|
+
Rdev = 0;
|
|
89
|
+
Size = 0;
|
|
90
|
+
Blksize = 0;
|
|
91
|
+
Blocks = 0;
|
|
92
|
+
Atime = 0;
|
|
93
|
+
Mtime = 0;
|
|
94
|
+
Ctime = 0;
|
|
95
|
+
AtimeNsec = 0;
|
|
96
|
+
MtimeNsec = 0;
|
|
97
|
+
CtimeNsec = 0;
|
|
98
|
+
constructor(init) {
|
|
99
|
+
if (init) {
|
|
100
|
+
Object.assign(this, init);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
clone() {
|
|
104
|
+
return new Stat_t(this);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Stub implementation of RawConn that always returns ErrUnimplemented
|
|
108
|
+
export class StubRawConn {
|
|
109
|
+
Control(f) {
|
|
110
|
+
return { Error: () => "operation not implemented in JavaScript environment" };
|
|
111
|
+
}
|
|
112
|
+
Read(f) {
|
|
113
|
+
return { Error: () => "operation not implemented in JavaScript environment" };
|
|
114
|
+
}
|
|
115
|
+
Write(f) {
|
|
116
|
+
return { Error: () => "operation not implemented in JavaScript environment" };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Additional error constants - implement as Errno type
|
|
120
|
+
export const ENOSYS = {
|
|
121
|
+
Error: () => "function not implemented",
|
|
122
|
+
Is: (target) => target === ENOSYS,
|
|
123
|
+
Errno: () => 38
|
|
124
|
+
};
|
|
125
|
+
export const EISDIR = {
|
|
126
|
+
Error: () => "is a directory",
|
|
127
|
+
Is: (target) => target === EISDIR,
|
|
128
|
+
Errno: () => 21
|
|
129
|
+
};
|
|
130
|
+
export const ENOTDIR = {
|
|
131
|
+
Error: () => "not a directory",
|
|
132
|
+
Is: (target) => target === ENOTDIR,
|
|
133
|
+
Errno: () => 20
|
|
134
|
+
};
|
|
135
|
+
export const ERANGE = {
|
|
136
|
+
Error: () => "result too large",
|
|
137
|
+
Is: (target) => target === ERANGE,
|
|
138
|
+
Errno: () => 34
|
|
139
|
+
};
|
|
140
|
+
export const ENOMEM = {
|
|
141
|
+
Error: () => "out of memory",
|
|
142
|
+
Is: (target) => target === ENOMEM,
|
|
143
|
+
Errno: () => 12
|
|
144
|
+
};
|
|
145
|
+
export const ESRCH = {
|
|
146
|
+
Error: () => "no such process",
|
|
147
|
+
Is: (target) => target === ESRCH,
|
|
148
|
+
Errno: () => 3
|
|
149
|
+
};
|
|
150
|
+
// Additional missing syscall functions
|
|
151
|
+
export function Open(path, flag, perm) {
|
|
152
|
+
return [-1, ENOSYS];
|
|
153
|
+
}
|
|
154
|
+
export function Sysctl(name) {
|
|
155
|
+
return ["", ENOSYS];
|
|
156
|
+
}
|
|
157
|
+
// Getpagesize returns the underlying system's memory page size.
|
|
158
|
+
export function Getpagesize() {
|
|
159
|
+
// Return a standard page size for JavaScript environment
|
|
160
|
+
// Most systems use 4096 bytes as the default page size
|
|
161
|
+
return 4096;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../gs/syscall/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAYlD,8BAA8B;AAC9B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAA;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAA;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAA;AACvB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAA;AACzB,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAA;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAA;AACtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAA;AACvB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAA;AAEvB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAA;AACvB,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAA;AAEzB,wBAAwB;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAA;AAC9B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAA;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAA;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAA;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AAE,EAAE,MAAM,CAAC,CAAA;AACrB,CAAC;AAID,gEAAgE;AAChE,MAAM,UAAU,WAAW;IACzB,yDAAyD;IACzD,uDAAuD;IACvD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -9,3 +9,4 @@ export declare function Slice(_ptr: Pointer, _len: IntegerType): any[];
|
|
|
9
9
|
export declare function SliceData(_slice: any[]): Pointer;
|
|
10
10
|
export declare function String(_ptr: Pointer, _len: IntegerType): string;
|
|
11
11
|
export declare function StringData(_str: string): Pointer;
|
|
12
|
+
export declare function Pointer(value: any): Pointer;
|
package/dist/gs/unsafe/unsafe.js
CHANGED
|
@@ -41,4 +41,9 @@ export function String(_ptr, _len) {
|
|
|
41
41
|
export function StringData(_str) {
|
|
42
42
|
throw new Error('unsafe.StringData is not supported in JavaScript/TypeScript: direct memory access is not available in JavaScript');
|
|
43
43
|
}
|
|
44
|
+
// Pointer converts a value to an unsafe.Pointer for atomic operations
|
|
45
|
+
// In JavaScript/TypeScript, this is just a pass-through function
|
|
46
|
+
export function Pointer(value) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
44
49
|
//# sourceMappingURL=unsafe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unsafe.js","sourceRoot":"","sources":["../../../gs/unsafe/unsafe.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,2FAA2F;AAC3F,mCAAmC;AAYnC,uEAAuE;AACvE,4DAA4D;AAC5D,MAAM,UAAU,OAAO,CAAC,SAAwB;IAC9C,MAAM,IAAI,KAAK,CACb,sHAAsH,CACvH,CAAA;AACH,CAAC;AAED,8EAA8E;AAC9E,4DAA4D;AAC5D,MAAM,UAAU,QAAQ,CAAC,SAAwB;IAC/C,MAAM,IAAI,KAAK,CACb,sIAAsI,CACvI,CAAA;AACH,CAAC;AAED,iEAAiE;AACjE,4DAA4D;AAC5D,MAAM,UAAU,MAAM,CAAC,SAAwB;IAC7C,MAAM,IAAI,KAAK,CACb,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D;AACtD,+DAA+D;AAC/D,MAAM,UAAU,GAAG,CAAC,IAAa,EAAE,IAAiB;IAClD,MAAM,IAAI,KAAK,CACb,yGAAyG,CAC1G,CAAA;AACH,CAAC;AAED,6DAA6D;AAC7D,4DAA4D;AAC5D,MAAM,UAAU,KAAK,CAAC,IAAa,EAAE,IAAiB;IACpD,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAA;AACH,CAAC;AAED,mEAAmE;AACnE,4DAA4D;AAC5D,MAAM,UAAU,SAAS,CAAC,MAAa;IACrC,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAA;AACH,CAAC;AAED,oEAAoE;AACpE,4DAA4D;AAC5D,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,IAAiB;IACrD,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAA;AACH,CAAC;AAED,kEAAkE;AAClE,4DAA4D;AAC5D,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,IAAI,KAAK,CACb,kHAAkH,CACnH,CAAA;AACH,CAAC;AAED,sEAAsE;AACtE,iEAAiE;AACjE,MAAM,UAAU,OAAO,CAAC,KAAU;IAChC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as $ from "@goscript/builtin/builtin.js";
|
|
2
|
+
|
|
3
|
+
// Stub implementations for internal/byteorder package
|
|
4
|
+
export function LittleEndian(): boolean {
|
|
5
|
+
return true // Assume little endian for JS
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Big Endian byte order functions
|
|
9
|
+
export function BEUint16(b: $.Bytes): number {
|
|
10
|
+
return (b![0] << 8) | b![1]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function BEUint32(b: $.Bytes): number {
|
|
14
|
+
return (b![0] << 24) | (b![1] << 16) | (b![2] << 8) | b![3]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function BEUint64(b: $.Bytes): number {
|
|
18
|
+
// JavaScript numbers are 64-bit floats, so we'll lose precision for very large integers
|
|
19
|
+
// For our stub purposes, this should be sufficient
|
|
20
|
+
let high = BEUint32(b)
|
|
21
|
+
let low = BEUint32($.goSlice(b, 4, undefined))
|
|
22
|
+
return (high * 0x100000000) + low
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Little Endian byte order functions
|
|
26
|
+
export function LEUint16(b: $.Bytes): number {
|
|
27
|
+
return b![0] | (b![1] << 8)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function LEUint32(b: $.Bytes): number {
|
|
31
|
+
return b![0] | (b![1] << 8) | (b![2] << 16) | (b![3] << 24)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function LEUint64(b: $.Bytes): number {
|
|
35
|
+
// JavaScript numbers are 64-bit floats, so we'll lose precision for very large integers
|
|
36
|
+
// For our stub purposes, this should be sufficient
|
|
37
|
+
let low = LEUint32(b)
|
|
38
|
+
let high = LEUint32($.goSlice(b, 4, undefined))
|
|
39
|
+
return low + (high * 0x100000000)
|
|
40
|
+
}
|
package/gs/maps/iter.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function Insert<K extends $.Comparable, V>(
|
|
|
58
58
|
|
|
59
59
|
// Collect collects key-value pairs from seq into a new map
|
|
60
60
|
// and returns it.
|
|
61
|
-
export function Collect<K extends $.Comparable, V
|
|
61
|
+
export function Collect<K extends $.Comparable, V>(
|
|
62
62
|
seq: iter.Seq2<K, V>,
|
|
63
63
|
): Map<K, V> {
|
|
64
64
|
let m = $.makeMap<K, V>()
|
|
@@ -46,8 +46,8 @@ describe('Erfinv', () => {
|
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
it('should handle very small values', () => {
|
|
49
|
-
expect(Erfinv(1e-10)).toBeCloseTo(8.862269254527579e-11, 14)
|
|
50
|
-
expect(Erfinv(-1e-10)).toBeCloseTo(-8.862269254527579e-11, 14)
|
|
49
|
+
expect(Erfinv(1e-10)).toBeCloseTo(8.862269254527579e-11, 14) //eslint-disable-line no-loss-of-precision
|
|
50
|
+
expect(Erfinv(-1e-10)).toBeCloseTo(-8.862269254527579e-11, 14) //eslint-disable-line no-loss-of-precision
|
|
51
51
|
})
|
|
52
52
|
|
|
53
53
|
it('should handle values close to boundaries', () => {
|
package/gs/math/fma.gs.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { FMA } from './fma.gs.js';
|
|
3
|
-
import { Inf, NaN, IsNaN
|
|
3
|
+
import { Inf, NaN as GoNaN, IsNaN } from './bits.gs.js';
|
|
4
4
|
|
|
5
5
|
describe('FMA', () => {
|
|
6
6
|
it('should compute fused multiply-add correctly for basic cases', () => {
|
|
@@ -35,10 +35,10 @@ describe('FMA', () => {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
it('should handle NaN cases', () => {
|
|
38
|
-
expect(IsNaN(FMA(
|
|
39
|
-
expect(IsNaN(FMA(2,
|
|
40
|
-
expect(IsNaN(FMA(2, 3,
|
|
41
|
-
expect(IsNaN(FMA(
|
|
38
|
+
expect(IsNaN(FMA(GoNaN(), 2, 3))).toBe(true);
|
|
39
|
+
expect(IsNaN(FMA(2, GoNaN(), 3))).toBe(true);
|
|
40
|
+
expect(IsNaN(FMA(2, 3, GoNaN()))).toBe(true);
|
|
41
|
+
expect(IsNaN(FMA(GoNaN(), GoNaN(), GoNaN()))).toBe(true);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
it('should handle special infinity and zero combinations', () => {
|
package/gs/math/ldexp.gs.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { Ldexp, ldexp } from './ldexp.gs.js';
|
|
3
3
|
import { Frexp } from './frexp.gs.js';
|
|
4
|
-
import { Inf, NaN, IsNaN
|
|
4
|
+
import { Inf, NaN as GoNaN, IsNaN } from './bits.gs.js';
|
|
5
5
|
|
|
6
6
|
describe('Ldexp', () => {
|
|
7
7
|
it('should compute frac × 2^exp correctly for basic cases', () => {
|
|
@@ -47,9 +47,9 @@ describe('Ldexp', () => {
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
it('should handle NaN cases', () => {
|
|
50
|
-
expect(IsNaN(Ldexp(
|
|
51
|
-
expect(IsNaN(Ldexp(
|
|
52
|
-
expect(IsNaN(Ldexp(
|
|
50
|
+
expect(IsNaN(Ldexp(GoNaN(), 5))).toBe(true);
|
|
51
|
+
expect(IsNaN(Ldexp(GoNaN(), -5))).toBe(true);
|
|
52
|
+
expect(IsNaN(Ldexp(GoNaN(), 0))).toBe(true);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('should be the inverse of Frexp', () => {
|
|
@@ -123,6 +123,6 @@ describe('ldexp (lowercase)', () => {
|
|
|
123
123
|
// Test special cases
|
|
124
124
|
expect(ldexp(Inf(1), 5)).toBe(Ldexp(Inf(1), 5));
|
|
125
125
|
expect(ldexp(Inf(-1), 5)).toBe(Ldexp(Inf(-1), 5));
|
|
126
|
-
expect(IsNaN(ldexp(
|
|
126
|
+
expect(IsNaN(ldexp(GoNaN(), 5))).toBe(IsNaN(Ldexp(GoNaN(), 5)));
|
|
127
127
|
});
|
|
128
128
|
});
|
|
@@ -94,8 +94,8 @@ describe('Lgamma', () => {
|
|
|
94
94
|
it('should satisfy reflection formula for negative values', () => {
|
|
95
95
|
// For non-integer x: Lgamma(x) + Lgamma(1-x) = log(π/sin(πx))
|
|
96
96
|
const x = 0.3
|
|
97
|
-
const [lgamma_x,
|
|
98
|
-
const [lgamma_1_minus_x,
|
|
97
|
+
const [lgamma_x, _sign_x] = Lgamma(x)
|
|
98
|
+
const [lgamma_1_minus_x, _sign_1_minus_x] = Lgamma(1 - x)
|
|
99
99
|
const expected = Math.log(Math.PI / Math.sin(Math.PI * x))
|
|
100
100
|
expect(lgamma_x + lgamma_1_minus_x).toBeCloseTo(expected, 5)
|
|
101
101
|
})
|
package/gs/os/dir.gs.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as $ from "@goscript/builtin/builtin.js";
|
|
2
|
+
import { ErrUnimplemented } from "./error.gs.js";
|
|
3
|
+
|
|
4
|
+
import * as fs from "@goscript/io/fs/index.js"
|
|
5
|
+
|
|
6
|
+
type DirEntry = fs.DirEntry;
|
|
7
|
+
|
|
8
|
+
// ReadDir reads the named directory,
|
|
9
|
+
// returning all its directory entries sorted by filename.
|
|
10
|
+
// If an error occurs reading the directory,
|
|
11
|
+
// ReadDir returns the entries it was able to read before the error,
|
|
12
|
+
// along with the error.
|
|
13
|
+
export function ReadDir(name: string): [$.Slice<DirEntry>, $.GoError] {
|
|
14
|
+
// Directory reading not supported in JavaScript environment
|
|
15
|
+
return [null, ErrUnimplemented]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// CopyFS copies the file system fsys into the directory dir,
|
|
19
|
+
// creating dir if necessary.
|
|
20
|
+
//
|
|
21
|
+
// Files are created with mode 0o666 plus any execute permissions
|
|
22
|
+
// from the source, and directories are created with mode 0o777
|
|
23
|
+
// (before umask).
|
|
24
|
+
//
|
|
25
|
+
// CopyFS will not overwrite existing files. If a file name in fsys
|
|
26
|
+
// already exists in the destination, CopyFS will return an error
|
|
27
|
+
// such that errors.Is(err, fs.ErrExist) will be true.
|
|
28
|
+
//
|
|
29
|
+
// Symbolic links in fsys are not supported. A *PathError with Err set
|
|
30
|
+
// to ErrInvalid is returned when copying from a symbolic link.
|
|
31
|
+
//
|
|
32
|
+
// Symbolic links in dir are followed.
|
|
33
|
+
//
|
|
34
|
+
// New files added to fsys (including if dir is a subdirectory of fsys)
|
|
35
|
+
// while CopyFS is running are not guaranteed to be copied.
|
|
36
|
+
//
|
|
37
|
+
// Copying stops at and returns the first error encountered.
|
|
38
|
+
export function CopyFS(dir: string, fsys: fs.FS): $.GoError {
|
|
39
|
+
// File system copying not supported in JavaScript environment
|
|
40
|
+
return ErrUnimplemented
|
|
41
|
+
}
|
|
42
|
+
|