goscript 0.0.36 → 0.0.38

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 (376) hide show
  1. package/compiler/analysis.go +129 -8
  2. package/compiler/compiler.go +4 -1
  3. package/compiler/composite-lit.go +2 -4
  4. package/compiler/expr-call.go +26 -0
  5. package/compiler/lit.go +83 -0
  6. package/compiler/protobuf.go +2 -2
  7. package/compiler/spec-value.go +3 -3
  8. package/compiler/spec.go +7 -4
  9. package/compiler/stmt-assign.go +1 -1
  10. package/compiler/stmt.go +26 -8
  11. package/dist/gs/builtin/slice.js +2 -1
  12. package/dist/gs/builtin/slice.js.map +1 -1
  13. package/dist/gs/github.com/pkg/errors/errors.d.ts +1 -1
  14. package/dist/gs/github.com/pkg/errors/errors.js +182 -23
  15. package/dist/gs/github.com/pkg/errors/errors.js.map +1 -1
  16. package/dist/gs/github.com/pkg/errors/go113.d.ts +1 -1
  17. package/dist/gs/github.com/pkg/errors/go113.js +1 -1
  18. package/dist/gs/github.com/pkg/errors/go113.js.map +1 -1
  19. package/dist/gs/github.com/pkg/errors/index.d.ts +3 -3
  20. package/dist/gs/github.com/pkg/errors/index.js +3 -3
  21. package/dist/gs/github.com/pkg/errors/index.js.map +1 -1
  22. package/dist/gs/github.com/pkg/errors/stack.d.ts +1 -1
  23. package/dist/gs/github.com/pkg/errors/stack.js +8 -5
  24. package/dist/gs/github.com/pkg/errors/stack.js.map +1 -1
  25. package/dist/gs/internal/abi/index.d.ts +20 -0
  26. package/dist/gs/internal/abi/index.js +20 -0
  27. package/dist/gs/internal/abi/index.js.map +1 -0
  28. package/dist/gs/internal/bytealg/index.d.ts +2 -0
  29. package/dist/gs/internal/bytealg/index.js +33 -0
  30. package/dist/gs/internal/bytealg/index.js.map +1 -0
  31. package/dist/gs/internal/byteorder/index.d.ts +8 -0
  32. package/dist/gs/internal/byteorder/index.js +34 -0
  33. package/dist/gs/internal/byteorder/index.js.map +1 -0
  34. package/dist/gs/internal/testlog/index.d.ts +1 -0
  35. package/dist/gs/internal/testlog/index.js +5 -0
  36. package/dist/gs/internal/testlog/index.js.map +1 -0
  37. package/dist/gs/math/index.d.ts +44 -44
  38. package/dist/gs/math/index.js +44 -44
  39. package/dist/gs/math/index.js.map +1 -1
  40. package/dist/gs/os/dir.gs.d.ts +6 -0
  41. package/dist/gs/os/dir.gs.js +35 -0
  42. package/dist/gs/os/dir.gs.js.map +1 -0
  43. package/dist/gs/os/dir_unix.gs.d.ts +7 -0
  44. package/dist/gs/os/dir_unix.gs.js +113 -0
  45. package/dist/gs/os/dir_unix.gs.js.map +1 -0
  46. package/dist/gs/os/dirent_js.gs.d.ts +5 -0
  47. package/dist/gs/os/dirent_js.gs.js +20 -0
  48. package/dist/gs/os/dirent_js.gs.js.map +1 -0
  49. package/dist/gs/os/env.gs.d.ts +12 -0
  50. package/dist/gs/os/env.gs.js +157 -0
  51. package/dist/gs/os/env.gs.js.map +1 -0
  52. package/dist/gs/os/error.gs.d.ts +40 -0
  53. package/dist/gs/os/error.gs.js +158 -0
  54. package/dist/gs/os/error.gs.js.map +1 -0
  55. package/dist/gs/os/error_errno.gs.d.ts +1 -0
  56. package/dist/gs/os/error_errno.gs.js +5 -0
  57. package/dist/gs/os/error_errno.gs.js.map +1 -0
  58. package/dist/gs/os/exec.gs.d.ts +60 -0
  59. package/dist/gs/os/exec.gs.js +136 -0
  60. package/dist/gs/os/exec.gs.js.map +1 -0
  61. package/dist/gs/os/exec_nohandle.gs.d.ts +1 -0
  62. package/dist/gs/os/exec_nohandle.gs.js +2 -0
  63. package/dist/gs/os/exec_nohandle.gs.js.map +1 -0
  64. package/dist/gs/os/exec_posix.gs.d.ts +25 -0
  65. package/dist/gs/os/exec_posix.gs.js +67 -0
  66. package/dist/gs/os/exec_posix.gs.js.map +1 -0
  67. package/dist/gs/os/exec_unix.gs.d.ts +4 -0
  68. package/dist/gs/os/exec_unix.gs.js +46 -0
  69. package/dist/gs/os/exec_unix.gs.js.map +1 -0
  70. package/dist/gs/os/executable.gs.d.ts +2 -0
  71. package/dist/gs/os/executable.gs.js +16 -0
  72. package/dist/gs/os/executable.gs.js.map +1 -0
  73. package/dist/gs/os/executable_js.gs.d.ts +2 -0
  74. package/dist/gs/os/executable_js.gs.js +5 -0
  75. package/dist/gs/os/executable_js.gs.js.map +1 -0
  76. package/dist/gs/os/executable_wasm.gs.d.ts +2 -0
  77. package/dist/gs/os/executable_wasm.gs.js +6 -0
  78. package/dist/gs/os/executable_wasm.gs.js.map +1 -0
  79. package/dist/gs/os/file_constants_js.gs.d.ts +41 -0
  80. package/dist/gs/os/file_constants_js.gs.js +78 -0
  81. package/dist/gs/os/file_constants_js.gs.js.map +1 -0
  82. package/dist/gs/os/file_js.gs.d.ts +22 -0
  83. package/dist/gs/os/file_js.gs.js +73 -0
  84. package/dist/gs/os/file_js.gs.js.map +1 -0
  85. package/dist/gs/os/file_open_unix.gs.d.ts +6 -0
  86. package/dist/gs/os/file_open_unix.gs.js +10 -0
  87. package/dist/gs/os/file_open_unix.gs.js.map +1 -0
  88. package/dist/gs/os/file_posix_js.gs.d.ts +8 -0
  89. package/dist/gs/os/file_posix_js.gs.js +32 -0
  90. package/dist/gs/os/file_posix_js.gs.js.map +1 -0
  91. package/dist/gs/os/file_unix_js.gs.d.ts +27 -0
  92. package/dist/gs/os/file_unix_js.gs.js +64 -0
  93. package/dist/gs/os/file_unix_js.gs.js.map +1 -0
  94. package/dist/gs/os/getwd_js.gs.d.ts +6 -0
  95. package/dist/gs/os/getwd_js.gs.js +21 -0
  96. package/dist/gs/os/getwd_js.gs.js.map +1 -0
  97. package/dist/gs/os/index.d.ts +19 -0
  98. package/dist/gs/os/index.js +20 -0
  99. package/dist/gs/os/index.js.map +1 -0
  100. package/dist/gs/os/path.gs.d.ts +4 -0
  101. package/dist/gs/os/path.gs.js +32 -0
  102. package/dist/gs/os/path.gs.js.map +1 -0
  103. package/dist/gs/os/path_unix.gs.d.ts +4 -0
  104. package/dist/gs/os/path_unix.gs.js +40 -0
  105. package/dist/gs/os/path_unix.gs.js.map +1 -0
  106. package/dist/gs/os/pidfd_js.gs.d.ts +6 -0
  107. package/dist/gs/os/pidfd_js.gs.js +14 -0
  108. package/dist/gs/os/pidfd_js.gs.js.map +1 -0
  109. package/dist/gs/os/pipe_wasm.gs.d.ts +2 -0
  110. package/dist/gs/os/pipe_wasm.gs.js +14 -0
  111. package/dist/gs/os/pipe_wasm.gs.js.map +1 -0
  112. package/dist/gs/os/proc.gs.d.ts +11 -0
  113. package/dist/gs/os/proc.gs.js +68 -0
  114. package/dist/gs/os/proc.gs.js.map +1 -0
  115. package/dist/gs/os/proc_js.gs.d.ts +3 -0
  116. package/dist/gs/os/proc_js.gs.js +12 -0
  117. package/dist/gs/os/proc_js.gs.js.map +1 -0
  118. package/dist/gs/os/rawconn_js.gs.d.ts +10 -0
  119. package/dist/gs/os/rawconn_js.gs.js +26 -0
  120. package/dist/gs/os/rawconn_js.gs.js.map +1 -0
  121. package/dist/gs/os/removeall_js.gs.d.ts +2 -0
  122. package/dist/gs/os/removeall_js.gs.js +7 -0
  123. package/dist/gs/os/removeall_js.gs.js.map +1 -0
  124. package/dist/gs/os/root_js.gs.d.ts +23 -0
  125. package/dist/gs/os/root_js.gs.js +80 -0
  126. package/dist/gs/os/root_js.gs.js.map +1 -0
  127. package/dist/gs/os/root_nonwindows.gs.d.ts +2 -0
  128. package/dist/gs/os/root_nonwindows.gs.js +4 -0
  129. package/dist/gs/os/root_nonwindows.gs.js.map +1 -0
  130. package/dist/gs/os/root_noopenat.gs.d.ts +11 -0
  131. package/dist/gs/os/root_noopenat.gs.js +31 -0
  132. package/dist/gs/os/root_noopenat.gs.js.map +1 -0
  133. package/dist/gs/os/stat.gs.d.ts +24 -0
  134. package/dist/gs/os/stat.gs.js +20 -0
  135. package/dist/gs/os/stat.gs.js.map +1 -0
  136. package/dist/gs/os/stat_js.gs.d.ts +6 -0
  137. package/dist/gs/os/stat_js.gs.js +23 -0
  138. package/dist/gs/os/stat_js.gs.js.map +1 -0
  139. package/dist/gs/os/stat_unix_js.gs.d.ts +8 -0
  140. package/dist/gs/os/stat_unix_js.gs.js +16 -0
  141. package/dist/gs/os/stat_unix_js.gs.js.map +1 -0
  142. package/dist/gs/os/sticky_bsd.gs.d.ts +1 -0
  143. package/dist/gs/os/sticky_bsd.gs.js +3 -0
  144. package/dist/gs/os/sticky_bsd.gs.js.map +1 -0
  145. package/dist/gs/os/sys.gs.d.ts +2 -0
  146. package/dist/gs/os/sys.gs.js +10 -0
  147. package/dist/gs/os/sys.gs.js.map +1 -0
  148. package/dist/gs/os/sys_bsd.gs.d.ts +2 -0
  149. package/dist/gs/os/sys_bsd.gs.js +15 -0
  150. package/dist/gs/os/sys_bsd.gs.js.map +1 -0
  151. package/dist/gs/os/sys_js.gs.d.ts +2 -0
  152. package/dist/gs/os/sys_js.gs.js +6 -0
  153. package/dist/gs/os/sys_js.gs.js.map +1 -0
  154. package/dist/gs/os/tempfile.gs.d.ts +5 -0
  155. package/dist/gs/os/tempfile.gs.js +30 -0
  156. package/dist/gs/os/tempfile.gs.js.map +1 -0
  157. package/dist/gs/os/types.gs.d.ts +59 -0
  158. package/dist/gs/os/types.gs.js +123 -0
  159. package/dist/gs/os/types.gs.js.map +1 -0
  160. package/dist/gs/os/types_js.gs.d.ts +74 -0
  161. package/dist/gs/os/types_js.gs.js +147 -0
  162. package/dist/gs/os/types_js.gs.js.map +1 -0
  163. package/dist/gs/os/types_unix.gs.d.ts +40 -0
  164. package/dist/gs/os/types_unix.gs.js +87 -0
  165. package/dist/gs/os/types_unix.gs.js.map +1 -0
  166. package/dist/gs/os/wait_unimp.gs.d.ts +1 -0
  167. package/dist/gs/os/wait_unimp.gs.js +2 -0
  168. package/dist/gs/os/wait_unimp.gs.js.map +1 -0
  169. package/dist/gs/os/zero_copy_posix.gs.d.ts +4 -0
  170. package/dist/gs/os/zero_copy_posix.gs.js +27 -0
  171. package/dist/gs/os/zero_copy_posix.gs.js.map +1 -0
  172. package/dist/gs/os/zero_copy_stub.gs.d.ts +1 -0
  173. package/dist/gs/os/zero_copy_stub.gs.js +2 -0
  174. package/dist/gs/os/zero_copy_stub.gs.js.map +1 -0
  175. package/dist/gs/reflect/abi.d.ts +59 -0
  176. package/dist/gs/reflect/abi.gs.d.ts +59 -0
  177. package/dist/gs/reflect/abi.gs.js +79 -0
  178. package/dist/gs/reflect/abi.gs.js.map +1 -0
  179. package/dist/gs/reflect/abi.js +79 -0
  180. package/dist/gs/reflect/abi.js.map +1 -0
  181. package/dist/gs/reflect/badlinkname.d.ts +52 -0
  182. package/dist/gs/reflect/badlinkname.gs.d.ts +52 -0
  183. package/dist/gs/reflect/badlinkname.gs.js +72 -0
  184. package/dist/gs/reflect/badlinkname.gs.js.map +1 -0
  185. package/dist/gs/reflect/badlinkname.js +72 -0
  186. package/dist/gs/reflect/badlinkname.js.map +1 -0
  187. package/dist/gs/reflect/deepequal.d.ts +1 -0
  188. package/dist/gs/reflect/deepequal.gs.d.ts +25 -0
  189. package/dist/gs/reflect/deepequal.gs.js +308 -0
  190. package/dist/gs/reflect/deepequal.gs.js.map +1 -0
  191. package/dist/gs/reflect/deepequal.js +139 -0
  192. package/dist/gs/reflect/deepequal.js.map +1 -0
  193. package/dist/gs/reflect/float32reg_generic.gs.d.ts +2 -0
  194. package/dist/gs/reflect/float32reg_generic.gs.js +10 -0
  195. package/dist/gs/reflect/float32reg_generic.gs.js.map +1 -0
  196. package/dist/gs/reflect/index.d.ts +8 -0
  197. package/dist/gs/reflect/index.gs.d.ts +1 -0
  198. package/dist/gs/reflect/index.gs.js +3 -0
  199. package/dist/gs/reflect/index.gs.js.map +1 -0
  200. package/dist/gs/reflect/index.js +10 -0
  201. package/dist/gs/reflect/index.js.map +1 -0
  202. package/dist/gs/reflect/iter.d.ts +4 -0
  203. package/dist/gs/reflect/iter.gs.d.ts +3 -0
  204. package/dist/gs/reflect/iter.gs.js +24 -0
  205. package/dist/gs/reflect/iter.gs.js.map +1 -0
  206. package/dist/gs/reflect/iter.js +24 -0
  207. package/dist/gs/reflect/iter.js.map +1 -0
  208. package/dist/gs/reflect/makefunc.gs.d.ts +34 -0
  209. package/dist/gs/reflect/makefunc.gs.js +288 -0
  210. package/dist/gs/reflect/makefunc.gs.js.map +1 -0
  211. package/dist/gs/reflect/map.d.ts +14 -0
  212. package/dist/gs/reflect/map.js +70 -0
  213. package/dist/gs/reflect/map.js.map +1 -0
  214. package/dist/gs/reflect/map_swiss.gs.d.ts +14 -0
  215. package/dist/gs/reflect/map_swiss.gs.js +70 -0
  216. package/dist/gs/reflect/map_swiss.gs.js.map +1 -0
  217. package/dist/gs/reflect/reflect.gs.d.ts +132 -0
  218. package/dist/gs/reflect/reflect.gs.js +437 -0
  219. package/dist/gs/reflect/reflect.gs.js.map +1 -0
  220. package/dist/gs/reflect/swapper.d.ts +2 -0
  221. package/dist/gs/reflect/swapper.gs.d.ts +1 -0
  222. package/dist/gs/reflect/swapper.gs.js +32 -0
  223. package/dist/gs/reflect/swapper.gs.js.map +1 -0
  224. package/dist/gs/reflect/swapper.js +46 -0
  225. package/dist/gs/reflect/swapper.js.map +1 -0
  226. package/dist/gs/reflect/type.d.ts +126 -0
  227. package/dist/gs/reflect/type.gs.d.ts +4 -0
  228. package/dist/gs/reflect/type.gs.js +21 -0
  229. package/dist/gs/reflect/type.gs.js.map +1 -0
  230. package/dist/gs/reflect/type.js +825 -0
  231. package/dist/gs/reflect/type.js.map +1 -0
  232. package/dist/gs/reflect/types.d.ts +90 -0
  233. package/dist/gs/reflect/types.js +119 -0
  234. package/dist/gs/reflect/types.js.map +1 -0
  235. package/dist/gs/reflect/value.d.ts +13 -0
  236. package/dist/gs/reflect/value.gs.d.ts +4 -0
  237. package/dist/gs/reflect/value.gs.js +12 -0
  238. package/dist/gs/reflect/value.gs.js.map +1 -0
  239. package/dist/gs/reflect/value.js +201 -0
  240. package/dist/gs/reflect/value.js.map +1 -0
  241. package/dist/gs/reflect/visiblefields.d.ts +4 -0
  242. package/dist/gs/reflect/visiblefields.gs.d.ts +3 -0
  243. package/dist/gs/reflect/visiblefields.gs.js +123 -0
  244. package/dist/gs/reflect/visiblefields.gs.js.map +1 -0
  245. package/dist/gs/reflect/visiblefields.js +143 -0
  246. package/dist/gs/reflect/visiblefields.js.map +1 -0
  247. package/dist/gs/strconv/index.d.ts +6 -6
  248. package/dist/gs/strconv/index.js +6 -6
  249. package/dist/gs/strconv/index.js.map +1 -1
  250. package/dist/gs/strings/index.d.ts +1 -1
  251. package/dist/gs/strings/index.js +1 -1
  252. package/dist/gs/strings/index.js.map +1 -1
  253. package/dist/gs/strings/replace.js.map +1 -1
  254. package/dist/gs/sync/atomic/index.d.ts +4 -4
  255. package/dist/gs/sync/atomic/index.js +4 -4
  256. package/dist/gs/sync/atomic/index.js.map +1 -1
  257. package/dist/gs/syscall/index.d.ts +80 -0
  258. package/dist/gs/syscall/index.js +169 -0
  259. package/dist/gs/syscall/index.js.map +1 -0
  260. package/dist/gs/unsafe/unsafe.js.map +1 -1
  261. package/gs/builtin/slice.ts +2 -1
  262. package/gs/github.com/pkg/errors/errors.ts +408 -238
  263. package/gs/github.com/pkg/errors/go113.ts +5 -6
  264. package/gs/github.com/pkg/errors/index.ts +12 -3
  265. package/gs/github.com/pkg/errors/stack.ts +107 -105
  266. package/gs/internal/abi/index.ts +37 -0
  267. package/gs/internal/bytealg/index.ts +34 -0
  268. package/gs/internal/byteorder/index.ts +40 -0
  269. package/gs/math/abs.gs.test.ts +1 -1
  270. package/gs/math/acosh.gs.test.ts +4 -2
  271. package/gs/math/asin.gs.test.ts +1 -1
  272. package/gs/math/asinh.gs.test.ts +7 -3
  273. package/gs/math/atan.gs.test.ts +1 -1
  274. package/gs/math/atan2.gs.test.ts +17 -9
  275. package/gs/math/atanh.gs.test.ts +1 -1
  276. package/gs/math/bits.gs.test.ts +1 -1
  277. package/gs/math/cbrt.gs.test.ts +1 -1
  278. package/gs/math/const.gs.test.ts +34 -8
  279. package/gs/math/copysign.gs.test.ts +7 -3
  280. package/gs/math/dim.gs.test.ts +19 -7
  281. package/gs/math/erf.gs.test.ts +1 -1
  282. package/gs/math/erfinv.gs.test.ts +4 -2
  283. package/gs/math/exp.gs.test.ts +1 -1
  284. package/gs/math/expm1.gs.test.ts +6 -4
  285. package/gs/math/floor.gs.test.ts +17 -4
  286. package/gs/math/fma.gs.test.ts +53 -53
  287. package/gs/math/frexp.gs.test.ts +112 -117
  288. package/gs/math/gamma.gs.test.ts +1 -1
  289. package/gs/math/hypot.gs.test.ts +53 -53
  290. package/gs/math/index.ts +80 -44
  291. package/gs/math/j0.gs.test.ts +6 -2
  292. package/gs/math/j1.gs.test.ts +6 -2
  293. package/gs/math/jn.gs.test.ts +9 -5
  294. package/gs/math/ldexp.gs.test.ts +103 -86
  295. package/gs/math/lgamma.gs.test.ts +10 -10
  296. package/gs/math/log.gs.test.ts +1 -1
  297. package/gs/math/log10.gs.test.ts +1 -1
  298. package/gs/math/log1p.gs.test.ts +2 -2
  299. package/gs/math/logb.gs.test.ts +1 -1
  300. package/gs/math/mod.gs.test.ts +2 -2
  301. package/gs/math/modf.gs.test.ts +7 -7
  302. package/gs/math/nextafter.gs.test.ts +9 -7
  303. package/gs/math/pow.gs.test.ts +6 -4
  304. package/gs/math/pow10.gs.test.ts +1 -1
  305. package/gs/math/remainder.gs.test.ts +1 -1
  306. package/gs/math/signbit.gs.test.ts +1 -1
  307. package/gs/math/sin.gs.test.ts +1 -1
  308. package/gs/math/sincos.gs.test.ts +33 -14
  309. package/gs/math/sinh.gs.test.ts +1 -1
  310. package/gs/math/sqrt.gs.test.ts +1 -1
  311. package/gs/math/tan.gs.test.ts +3 -3
  312. package/gs/math/tanh.gs.test.ts +1 -1
  313. package/gs/os/dir.gs.ts +42 -0
  314. package/gs/os/dir_unix.gs.ts +155 -0
  315. package/gs/os/dirent_js.gs.ts +27 -0
  316. package/gs/os/env.gs.ts +179 -0
  317. package/gs/os/error.gs.ts +205 -0
  318. package/gs/os/error_errno.gs.ts +12 -0
  319. package/gs/os/exec.gs.ts +198 -0
  320. package/gs/os/exec_nohandle.gs.ts +2 -0
  321. package/gs/os/exec_posix.gs.ts +95 -0
  322. package/gs/os/exec_unix.gs.ts +64 -0
  323. package/gs/os/executable.gs.ts +18 -0
  324. package/gs/os/executable_js.gs.ts +6 -0
  325. package/gs/os/executable_wasm.gs.ts +10 -0
  326. package/gs/os/file_constants_js.gs.ts +98 -0
  327. package/gs/os/file_js.gs.ts +99 -0
  328. package/gs/os/file_open_unix.gs.ts +15 -0
  329. package/gs/os/file_posix_js.gs.ts +40 -0
  330. package/gs/os/file_unix_js.gs.ts +94 -0
  331. package/gs/os/getwd_js.gs.ts +28 -0
  332. package/gs/os/index.ts +128 -0
  333. package/gs/os/path.gs.ts +35 -0
  334. package/gs/os/path_unix.gs.ts +49 -0
  335. package/gs/os/pidfd_js.gs.ts +25 -0
  336. package/gs/os/pipe_wasm.gs.ts +17 -0
  337. package/gs/os/proc.gs.ts +84 -0
  338. package/gs/os/proc_js.gs.ts +15 -0
  339. package/gs/os/rawconn_js.gs.ts +30 -0
  340. package/gs/os/removeall_js.gs.ts +9 -0
  341. package/gs/os/root_js.gs.ts +111 -0
  342. package/gs/os/root_nonwindows.gs.ts +6 -0
  343. package/gs/os/root_noopenat.gs.ts +45 -0
  344. package/gs/os/stat.gs.ts +38 -0
  345. package/gs/os/stat_js.gs.ts +30 -0
  346. package/gs/os/stat_unix_js.gs.ts +27 -0
  347. package/gs/os/sticky_bsd.gs.ts +4 -0
  348. package/gs/os/sys.gs.ts +12 -0
  349. package/gs/os/sys_bsd.gs.ts +17 -0
  350. package/gs/os/sys_js.gs.ts +9 -0
  351. package/gs/os/tempfile.gs.ts +34 -0
  352. package/gs/os/types.gs.ts +170 -0
  353. package/gs/os/types_js.gs.ts +205 -0
  354. package/gs/os/types_unix.gs.ts +118 -0
  355. package/gs/os/wait_unimp.gs.ts +2 -0
  356. package/gs/os/zero_copy_posix.gs.ts +35 -0
  357. package/gs/os/zero_copy_stub.gs.ts +4 -0
  358. package/gs/reflect/ANALYSIS.md +278 -0
  359. package/gs/reflect/deepequal.ts +154 -0
  360. package/gs/reflect/function-types.test.ts +146 -0
  361. package/gs/reflect/godoc.txt +67 -0
  362. package/gs/reflect/index.ts +83 -0
  363. package/gs/reflect/iter.ts +44 -0
  364. package/gs/reflect/map.ts +81 -0
  365. package/gs/reflect/swapper.ts +52 -0
  366. package/gs/reflect/type.ts +1012 -0
  367. package/gs/reflect/types.ts +214 -0
  368. package/gs/reflect/value.ts +264 -0
  369. package/gs/reflect/visiblefields.ts +173 -0
  370. package/gs/strconv/index.ts +39 -6
  371. package/gs/strings/index.ts +7 -1
  372. package/gs/strings/replace.ts +1 -9
  373. package/gs/sync/atomic/index.ts +53 -4
  374. package/gs/syscall/index.ts +212 -0
  375. package/gs/unsafe/unsafe.ts +1 -1
  376. package/package.json +2 -1
@@ -0,0 +1,20 @@
1
+ export { CopyFS, ReadDir } from './dir.gs.js';
2
+ export { Clearenv, Environ, Expand, ExpandEnv, Getenv, LookupEnv, Setenv, Unsetenv, } from './env.gs.js';
3
+ export { ErrClosed, ErrDeadlineExceeded, ErrExist, ErrInvalid, ErrNoDeadline, ErrNotExist, ErrPermission, ErrUnimplemented, IsExist, IsNotExist, IsPermission, IsTimeout, NewSyscallError, PathError, SyscallError, } from './error.gs.js';
4
+ export { ErrProcessDone, FindProcess, Getpid, Getppid, ProcAttr, Process, Signal, StartProcess, } from './exec.gs.js';
5
+ export { Interrupt, Kill, ProcessState } from './exec_posix.gs.js';
6
+ export { Executable } from './executable.gs.js';
7
+ export { Chdir, Chmod, Create, DirFS, Mkdir, Open, OpenFile, ReadFile, Rename, WriteFile, MkdirAll, RemoveAll, } from './file_js.gs.js';
8
+ export { LinkError, O_APPEND, O_CREATE, O_EXCL, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY, Readlink, SEEK_CUR, SEEK_END, SEEK_SET, TempDir, UserCacheDir, UserConfigDir, UserHomeDir, } from './file_constants_js.gs.js';
9
+ export { DevNull, Link, NewFile, Remove, Stderr, Stdin, Stdout, Symlink, Truncate, } from './file_unix_js.gs.js';
10
+ export { Chown, Chtimes, Lchown } from './file_posix_js.gs.js';
11
+ export { Getwd } from './getwd_js.gs.js';
12
+ export { IsPathSeparator, PathListSeparator, PathSeparator, } from './path_unix.gs.js';
13
+ export { Pipe } from './pipe_wasm.gs.js';
14
+ export { Args, Exit, Getegid, Geteuid, Getgid, Getgroups, Getuid, } from './proc.gs.js';
15
+ export { OpenInRoot, OpenRoot, Root } from './root_js.gs.js';
16
+ export { Lstat, Stat } from './stat_js.gs.js';
17
+ export { Hostname } from './sys.gs.js';
18
+ export { CreateTemp, MkdirTemp } from './tempfile.gs.js';
19
+ export { DirEntry, File, FileInfo, FileMode, Getpagesize, ModeAppend, ModeCharDevice, ModeDevice, ModeDir, ModeExclusive, ModeIrregular, ModeNamedPipe, ModePerm, ModeSetgid, ModeSetuid, ModeSocket, ModeSticky, ModeSymlink, ModeTemporary, ModeType, SameFile, } from './types_js.gs.js';
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../gs/os/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,WAAW,EACX,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,GACT,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,aAAa,GACd,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,GACP,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,cAAc,EACd,UAAU,EACV,OAAO,EACP,aAAa,EACb,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare function MkdirAll(path: string, perm: number): $.GoError;
3
+ export declare function RemoveAll(path: string): $.GoError;
4
+ export declare function endsWithDot(path: string): boolean;
@@ -0,0 +1,32 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { ErrUnimplemented } from "./error.gs.js";
3
+ import { IsPathSeparator } from "./path_unix.gs.js";
4
+ // MkdirAll creates a directory named path,
5
+ // along with any necessary parents, and returns nil,
6
+ // or else returns an error.
7
+ // The permission bits perm (before umask) are used for all
8
+ // directories that MkdirAll creates.
9
+ // If path is already a directory, MkdirAll does nothing
10
+ // and returns nil.
11
+ export function MkdirAll(path, perm) {
12
+ return ErrUnimplemented;
13
+ }
14
+ // RemoveAll removes path and any children it contains.
15
+ // It removes everything it can but returns the first error
16
+ // it encounters. If the path does not exist, RemoveAll
17
+ // returns nil (no error).
18
+ // If there is an error, it will be of type [*PathError].
19
+ export function RemoveAll(path) {
20
+ return ErrUnimplemented;
21
+ }
22
+ // endsWithDot reports whether the final component of path is ".".
23
+ export function endsWithDot(path) {
24
+ if (path == ".") {
25
+ return true;
26
+ }
27
+ if ($.len(path) >= 2 && $.indexString(path, $.len(path) - 1) == 46 && IsPathSeparator($.indexString(path, $.len(path) - 2))) {
28
+ return true;
29
+ }
30
+ return false;
31
+ }
32
+ //# sourceMappingURL=path.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.gs.js","sourceRoot":"","sources":["../../../gs/os/path.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,2CAA2C;AAC3C,qDAAqD;AACrD,4BAA4B;AAC5B,2DAA2D;AAC3D,qCAAqC;AACrC,wDAAwD;AACxD,mBAAmB;AACnB,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,IAAY;IAClD,OAAO,gBAAgB,CAAA;AACxB,CAAC;AAED,uDAAuD;AACvD,2DAA2D;AAC3D,uDAAuD;AACvD,0BAA0B;AAC1B,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,OAAO,gBAAgB,CAAA;AACxB,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;QACjB,OAAO,IAAI,CAAA;IACZ,CAAC;IACD,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7H,OAAO,IAAI,CAAA;IACZ,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare let PathSeparator: number;
2
+ export declare let PathListSeparator: number;
3
+ export declare function IsPathSeparator(c: number): boolean;
4
+ export declare function splitPath(path: string): [string, string];
@@ -0,0 +1,40 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ // OS-specific path separator
3
+ export let PathSeparator = 47;
4
+ // OS-specific path list separator
5
+ export let PathListSeparator = 58;
6
+ // IsPathSeparator reports whether c is a directory separator character.
7
+ export function IsPathSeparator(c) {
8
+ return 47 == c;
9
+ }
10
+ // splitPath returns the base name and parent directory.
11
+ export function splitPath(path) {
12
+ // if no better parent is found, the path is relative from "here"
13
+ let dirname = ".";
14
+ // Remove all but one leading slash.
15
+ for (; $.len(path) > 1 && $.indexString(path, 0) == 47 && $.indexString(path, 1) == 47;) {
16
+ path = $.sliceString(path, 1, undefined);
17
+ }
18
+ let i = $.len(path) - 1;
19
+ // Remove trailing slashes.
20
+ for (; i > 0 && $.indexString(path, i) == 47; i--) {
21
+ path = $.sliceString(path, undefined, i);
22
+ }
23
+ // if no slashes in path, base is path
24
+ let basename = path;
25
+ // Remove leading directory path
26
+ for (i--; i >= 0; i--) {
27
+ if ($.indexString(path, i) == 47) {
28
+ if (i == 0) {
29
+ dirname = $.sliceString(path, undefined, 1);
30
+ }
31
+ else {
32
+ dirname = $.sliceString(path, undefined, i);
33
+ }
34
+ basename = $.sliceString(path, i + 1, undefined);
35
+ break;
36
+ }
37
+ }
38
+ return [dirname, basename];
39
+ }
40
+ //# sourceMappingURL=path_unix.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path_unix.gs.js","sourceRoot":"","sources":["../../../gs/os/path_unix.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,6BAA6B;AAC7B,MAAM,CAAC,IAAI,aAAa,GAAW,EAAE,CAAA;AAErC,kCAAkC;AAClC,MAAM,CAAC,IAAI,iBAAiB,GAAW,EAAE,CAAA;AAEzC,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,CAAS;IACxC,OAAO,EAAE,IAAI,CAAC,CAAA;AACf,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,iEAAiE;IACjE,IAAI,OAAO,GAAG,GAAG,CAAA;IAEjB,oCAAoC;IACpC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAI,CAAC;QAC1F,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;IACzC,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAEvB,2BAA2B;IAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,sCAAsC;IACtC,IAAI,QAAQ,GAAG,IAAI,CAAA;IAEnB,gCAAgC;IAChC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACZ,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;YAC5C,CAAC;iBAAM,CAAC;gBACP,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;YAC5C,CAAC;YACD,QAAQ,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAA;YAChD,MAAK;QACN,CAAC;IACF,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export interface SysProcAttr {
3
+ }
4
+ export declare function ensurePidfd(sysAttr: SysProcAttr | null): [SysProcAttr | null, boolean];
5
+ export declare function getPidfd(_: SysProcAttr | null, _usePidfd: boolean): [number, boolean];
6
+ export declare function pidfdFind(_: number): [number, $.GoError];
@@ -0,0 +1,14 @@
1
+ import { ErrUnimplemented } from "./error.gs.js";
2
+ // ensurePidfd ensures pidfd support - stub implementation
3
+ export function ensurePidfd(sysAttr) {
4
+ return [null, false];
5
+ }
6
+ // getPidfd gets a process file descriptor - stub implementation
7
+ export function getPidfd(_, _usePidfd) {
8
+ return [0, false];
9
+ }
10
+ // pidfdFind finds a process by pidfd - stub implementation
11
+ export function pidfdFind(_) {
12
+ return [0, ErrUnimplemented];
13
+ }
14
+ //# sourceMappingURL=pidfd_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pidfd_js.gs.js","sourceRoot":"","sources":["../../../gs/os/pidfd_js.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAUjD,0DAA0D;AAC1D,MAAM,UAAU,WAAW,CAAC,OAA2B;IACtD,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACrB,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,QAAQ,CAAC,CAAqB,EAAE,SAAkB;IACjE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAClB,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,SAAS,CAAC,CAAS;IAClC,OAAO,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAA;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare function Pipe(): [File | null, File | null, $.GoError];
@@ -0,0 +1,14 @@
1
+ import { NewSyscallError } from "./error.gs.js";
2
+ import * as syscall from "@goscript/syscall/index.js";
3
+ // Pipe returns a connected pair of Files; reads from r return bytes written to w.
4
+ // It returns the files and an error, if any.
5
+ export function Pipe() {
6
+ let r = null;
7
+ let w = null;
8
+ let err = null;
9
+ {
10
+ // Neither GOOS=js nor GOOS=wasip1 have pipes.
11
+ return [null, null, NewSyscallError("pipe", syscall.ENOSYS)];
12
+ }
13
+ }
14
+ //# sourceMappingURL=pipe_wasm.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipe_wasm.gs.js","sourceRoot":"","sources":["../../../gs/os/pipe_wasm.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAA;AAErD,kFAAkF;AAClF,6CAA6C;AAC7C,MAAM,UAAU,IAAI;IACnB,IAAI,CAAC,GAAgB,IAAI,CAAA;IACzB,IAAI,CAAC,GAAgB,IAAI,CAAA;IACzB,IAAI,GAAG,GAAc,IAAI,CAAA;IACzB,CAAC;QACA,8CAA8C;QAC9C,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAC7D,CAAC;AACF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare let Args: $.Slice<string>;
3
+ export declare function init(): void;
4
+ export declare function runtime_args(): $.Slice<string>;
5
+ export declare function Getuid(): number;
6
+ export declare function Geteuid(): number;
7
+ export declare function Getgid(): number;
8
+ export declare function Getegid(): number;
9
+ export declare function Getgroups(): [$.Slice<number>, $.GoError];
10
+ export declare function Exit(code: number): void;
11
+ export declare function runtime_beforeExit(exitCode: number): void;
@@ -0,0 +1,68 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { ErrUnimplemented } from "./error.gs.js";
3
+ export let Args = null;
4
+ export function init() {
5
+ // In JavaScript environment, just initialize with empty args
6
+ Args = runtime_args();
7
+ }
8
+ export function runtime_args() {
9
+ return $.arrayToSlice([]);
10
+ }
11
+ // Getuid returns the numeric user id of the caller.
12
+ //
13
+ // On Windows, it returns -1.
14
+ export function Getuid() {
15
+ return -1; // Not available in JavaScript
16
+ }
17
+ // Geteuid returns the numeric effective user id of the caller.
18
+ //
19
+ // On Windows, it returns -1.
20
+ export function Geteuid() {
21
+ return -1; // Not available in JavaScript
22
+ }
23
+ // Getgid returns the numeric group id of the caller.
24
+ //
25
+ // On Windows, it returns -1.
26
+ export function Getgid() {
27
+ return -1; // Not available in JavaScript
28
+ }
29
+ // Getegid returns the numeric effective group id of the caller.
30
+ //
31
+ // On Windows, it returns -1.
32
+ export function Getegid() {
33
+ return -1; // Not available in JavaScript
34
+ }
35
+ // Getgroups returns a list of the numeric ids of groups that the caller belongs to.
36
+ //
37
+ // On Windows, it returns [syscall.EWINDOWS]. See the [os/user] package
38
+ // for a possible alternative.
39
+ export function Getgroups() {
40
+ return [$.arrayToSlice([]), ErrUnimplemented];
41
+ }
42
+ // Exit causes the current program to exit with the given status code.
43
+ // Conventionally, code zero indicates success, non-zero an error.
44
+ // The program terminates immediately; deferred functions are not run.
45
+ //
46
+ // For portability, the status code should be in the range [0, 125].
47
+ export function Exit(code) {
48
+ // Testlog functionality not available in JavaScript - stub
49
+ // if (code == 0 && testlog.PanicOnExit0()) {
50
+ // $.panic("unexpected call to os.Exit(0) during test")
51
+ // }
52
+ // Inform the runtime that os.Exit is being called. If -race is
53
+ // enabled, this will give race detector a chance to fail the
54
+ // program (racy programs do not have the right to finish
55
+ // successfully). If coverage is enabled, then this call will
56
+ // enable us to write out a coverage data file.
57
+ runtime_beforeExit(code);
58
+ // In JavaScript environment, use process.exit if available
59
+ if (typeof process !== 'undefined' && process.exit) {
60
+ process.exit(code);
61
+ }
62
+ else {
63
+ // Fallback: just return (can't really exit in browser)
64
+ return;
65
+ }
66
+ }
67
+ export function runtime_beforeExit(exitCode) { }
68
+ //# sourceMappingURL=proc.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proc.gs.js","sourceRoot":"","sources":["../../../gs/os/proc.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAmB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMlE,MAAM,CAAC,IAAI,IAAI,GAAoB,IAAI,CAAA;AAEvC,MAAM,UAAU,IAAI;IACnB,6DAA6D;IAC7D,IAAI,GAAG,YAAY,EAAE,CAAA;AACtB,CAAC;AAED,MAAM,UAAU,YAAY;IAC3B,OAAO,CAAC,CAAC,YAAY,CAAS,EAAE,CAAC,CAAA;AAClC,CAAC;AAED,oDAAoD;AACpD,EAAE;AACF,6BAA6B;AAC7B,MAAM,UAAU,MAAM;IACrB,OAAO,CAAC,CAAC,CAAA,CAAC,8BAA8B;AACzC,CAAC;AAED,+DAA+D;AAC/D,EAAE;AACF,6BAA6B;AAC7B,MAAM,UAAU,OAAO;IACtB,OAAO,CAAC,CAAC,CAAA,CAAC,8BAA8B;AACzC,CAAC;AAED,qDAAqD;AACrD,EAAE;AACF,6BAA6B;AAC7B,MAAM,UAAU,MAAM;IACrB,OAAO,CAAC,CAAC,CAAA,CAAC,8BAA8B;AACzC,CAAC;AAED,gEAAgE;AAChE,EAAE;AACF,6BAA6B;AAC7B,MAAM,UAAU,OAAO;IACtB,OAAO,CAAC,CAAC,CAAA,CAAC,8BAA8B;AACzC,CAAC;AAED,oFAAoF;AACpF,EAAE;AACF,uEAAuE;AACvE,8BAA8B;AAC9B,MAAM,UAAU,SAAS;IACxB,OAAO,CAAC,CAAC,CAAC,YAAY,CAAS,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAA;AACtD,CAAC;AAED,sEAAsE;AACtE,kEAAkE;AAClE,sEAAsE;AACtE,EAAE;AACF,oEAAoE;AACpE,MAAM,UAAU,IAAI,CAAC,IAAY;IAEhC,2DAA2D;IAC3D,6CAA6C;IAC7C,uDAAuD;IACvD,IAAI;IAEJ,+DAA+D;IAC/D,6DAA6D;IAC7D,yDAAyD;IACzD,6DAA6D;IAC7D,+CAA+C;IAC/C,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAExB,2DAA2D;IAC3D,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC;SAAM,CAAC;QACP,uDAAuD;QACvD,OAAM;IACP,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgB,IAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare function runtime_args(): $.Slice<string>;
3
+ export declare function runtime_beforeExit(exitCode: number): void;
@@ -0,0 +1,12 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ // JavaScript-specific process functions
3
+ // runtime_args returns command line arguments (stub for JS)
4
+ export function runtime_args() {
5
+ // In JavaScript environment, return empty args or process.argv equivalent
6
+ return $.arrayToSlice([]);
7
+ }
8
+ // runtime_beforeExit is called before exit (stub for JS)
9
+ export function runtime_beforeExit(exitCode) {
10
+ // No-op in JavaScript
11
+ }
12
+ //# sourceMappingURL=proc_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proc_js.gs.js","sourceRoot":"","sources":["../../../gs/os/proc_js.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,wCAAwC;AAExC,4DAA4D;AAC5D,MAAM,UAAU,YAAY;IAC3B,0EAA0E;IAC1E,OAAO,CAAC,CAAC,YAAY,CAAS,EAAE,CAAC,CAAA;AAClC,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAClD,sBAAsB;AACvB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { File } from "./types_js.gs.js";
3
+ export declare class rawConn {
4
+ private file;
5
+ constructor(file: File | null);
6
+ Control(f: ((fd: number) => void) | null): $.GoError;
7
+ Read(f: ((fd: number) => boolean) | null): $.GoError;
8
+ Write(f: ((fd: number) => boolean) | null): $.GoError;
9
+ }
10
+ export declare function newRawConn(file: File | null): rawConn;
@@ -0,0 +1,26 @@
1
+ import { ErrUnimplemented } from "./error.gs.js";
2
+ // JavaScript-specific stub for raw connection operations
3
+ // These operations are not available in JavaScript environments
4
+ export class rawConn {
5
+ file;
6
+ constructor(file) {
7
+ this.file = file;
8
+ }
9
+ // Control calls fn with the file descriptor - stub implementation
10
+ Control(f) {
11
+ return ErrUnimplemented;
12
+ }
13
+ // Read calls fn when the file descriptor is ready for reading - stub implementation
14
+ Read(f) {
15
+ return ErrUnimplemented;
16
+ }
17
+ // Write calls fn when the file descriptor is ready for writing - stub implementation
18
+ Write(f) {
19
+ return ErrUnimplemented;
20
+ }
21
+ }
22
+ // newRawConn creates a new raw connection - stub implementation
23
+ export function newRawConn(file) {
24
+ return new rawConn(file);
25
+ }
26
+ //# sourceMappingURL=rawconn_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rawconn_js.gs.js","sourceRoot":"","sources":["../../../gs/os/rawconn_js.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,yDAAyD;AACzD,gEAAgE;AAEhE,MAAM,OAAO,OAAO;IACC;IAApB,YAAoB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC,kEAAkE;IAC3D,OAAO,CAAC,CAAgC;QAC9C,OAAO,gBAAgB,CAAA;IACxB,CAAC;IAED,sFAAsF;IAC/E,IAAI,CAAC,CAAmC;QAC9C,OAAO,gBAAgB,CAAA;IACxB,CAAC;IAED,qFAAqF;IAC9E,KAAK,CAAC,CAAmC;QAC/C,OAAO,gBAAgB,CAAA;IACxB,CAAC;CACD;AAED,gEAAgE;AAChE,MAAM,UAAU,UAAU,CAAC,IAAiB;IAC3C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare function RemoveAll(path: string): $.GoError;
@@ -0,0 +1,7 @@
1
+ import { ErrUnimplemented } from "./error.gs.js";
2
+ // JavaScript-specific stub for removeall operations
3
+ // These operations cannot be implemented in JavaScript environments
4
+ export function RemoveAll(path) {
5
+ return ErrUnimplemented;
6
+ }
7
+ //# sourceMappingURL=removeall_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeall_js.gs.js","sourceRoot":"","sources":["../../../gs/os/removeall_js.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,oDAAoD;AACpD,oEAAoE;AAEpE,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,OAAO,gBAAgB,CAAA;AACxB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { File } from "./types_js.gs.js";
3
+ import * as fs from "@goscript/io/fs/index.js";
4
+ export declare function OpenInRoot(dir: string, name: string): [File | null, $.GoError];
5
+ export declare class Root {
6
+ constructor();
7
+ Name(): string;
8
+ Close(): $.GoError;
9
+ Open(name: string): [File | null, $.GoError];
10
+ Create(name: string): [File | null, $.GoError];
11
+ OpenFile(name: string, flag: number, perm: number): [File | null, $.GoError];
12
+ OpenRoot(name: string): [RootType | null, $.GoError];
13
+ Mkdir(name: string, perm: number): $.GoError;
14
+ Remove(name: string): $.GoError;
15
+ Stat(name: string): [fs.FileInfo | null, $.GoError];
16
+ Lstat(name: string): [fs.FileInfo | null, $.GoError];
17
+ FS(): fs.FS;
18
+ static __typeInfo: $.StructTypeInfo;
19
+ }
20
+ export type RootType = Root;
21
+ export declare function OpenRoot(name: string): [Root | null, $.GoError];
22
+ export declare function splitPathInRoot(s: string, prefix: $.Slice<string> | null, suffix: $.Slice<string> | null): [$.Slice<string>, string, $.GoError];
23
+ export declare function isValidRootFSPath(name: string): boolean;
@@ -0,0 +1,80 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { ErrUnimplemented } from "./error.gs.js";
3
+ // JavaScript-specific implementations for root filesystem operations
4
+ // These functions stub operations that cannot be implemented in JavaScript
5
+ // OpenInRoot opens the file name in the directory dir - stub implementation
6
+ export function OpenInRoot(dir, name) {
7
+ return [null, ErrUnimplemented];
8
+ }
9
+ // Root represents a root filesystem - stub implementation
10
+ export class Root {
11
+ constructor() { }
12
+ // Name returns the name of the directory presented to OpenRoot
13
+ Name() {
14
+ return "";
15
+ }
16
+ // Close closes the Root
17
+ Close() {
18
+ return ErrUnimplemented;
19
+ }
20
+ // Open opens the named file in the root for reading
21
+ Open(name) {
22
+ return [null, ErrUnimplemented];
23
+ }
24
+ // Create creates or truncates the named file in the root
25
+ Create(name) {
26
+ return [null, ErrUnimplemented];
27
+ }
28
+ // OpenFile opens the named file in the root
29
+ OpenFile(name, flag, perm) {
30
+ return [null, ErrUnimplemented];
31
+ }
32
+ // OpenRoot opens the named directory in the root
33
+ OpenRoot(name) {
34
+ return [null, ErrUnimplemented];
35
+ }
36
+ // Mkdir creates a new directory in the root
37
+ Mkdir(name, perm) {
38
+ return ErrUnimplemented;
39
+ }
40
+ // Remove removes the named file or directory in the root
41
+ Remove(name) {
42
+ return ErrUnimplemented;
43
+ }
44
+ // Stat returns a FileInfo describing the named file in the root
45
+ Stat(name) {
46
+ return [null, ErrUnimplemented];
47
+ }
48
+ // Lstat returns a FileInfo describing the named file in the root
49
+ Lstat(name) {
50
+ return [null, ErrUnimplemented];
51
+ }
52
+ // FS returns a file system for the tree of files in the root
53
+ FS() {
54
+ return new stubFS();
55
+ }
56
+ // Register this type with the runtime type system
57
+ static __typeInfo = $.registerStructType('Root', new Root(), [
58
+ { name: "Name", args: [], returns: [{ type: { kind: $.TypeKind.Basic, name: 'string' } }] },
59
+ { name: "Close", args: [], returns: [{ type: { kind: $.TypeKind.Interface, name: 'GoError', methods: [{ name: 'Error', args: [], returns: [{ type: { kind: $.TypeKind.Basic, name: 'string' } }] }] } }] }
60
+ ], Root, {});
61
+ }
62
+ // OpenRoot opens a root filesystem - stub implementation
63
+ export function OpenRoot(name) {
64
+ return [null, ErrUnimplemented];
65
+ }
66
+ // splitPathInRoot splits a path in root - stub implementation
67
+ export function splitPathInRoot(s, prefix, suffix) {
68
+ return [null, "", ErrUnimplemented];
69
+ }
70
+ // isValidRootFSPath checks if a path is valid for root filesystem - stub implementation
71
+ export function isValidRootFSPath(name) {
72
+ return false;
73
+ }
74
+ // Internal stub filesystem
75
+ class stubFS {
76
+ Open(name) {
77
+ return [null, ErrUnimplemented];
78
+ }
79
+ }
80
+ //# sourceMappingURL=root_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root_js.gs.js","sourceRoot":"","sources":["../../../gs/os/root_js.gs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,qEAAqE;AACrE,2EAA2E;AAE3E,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,IAAY;IACnD,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,0DAA0D;AAC1D,MAAM,OAAO,IAAI;IAChB,gBAAe,CAAC;IAEhB,+DAA+D;IACxD,IAAI;QACV,OAAO,EAAE,CAAA;IACV,CAAC;IAED,wBAAwB;IACjB,KAAK;QACX,OAAO,gBAAgB,CAAA;IACxB,CAAC;IAED,oDAAoD;IAC7C,IAAI,CAAC,IAAY;QACvB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,yDAAyD;IAClD,MAAM,CAAC,IAAY;QACzB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,4CAA4C;IACrC,QAAQ,CAAC,IAAY,EAAE,IAAY,EAAE,IAAY;QACvD,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,iDAAiD;IAC1C,QAAQ,CAAC,IAAY;QAC3B,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,4CAA4C;IACrC,KAAK,CAAC,IAAY,EAAE,IAAY;QACtC,OAAO,gBAAgB,CAAA;IACxB,CAAC;IAED,yDAAyD;IAClD,MAAM,CAAC,IAAY;QACzB,OAAO,gBAAgB,CAAA;IACxB,CAAC;IAED,gEAAgE;IACzD,IAAI,CAAC,IAAY;QACvB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,iEAAiE;IAC1D,KAAK,CAAC,IAAY;QACxB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;IAED,6DAA6D;IACtD,EAAE;QACR,OAAO,IAAI,MAAM,EAAE,CAAA;IACpB,CAAC;IAED,kDAAkD;IAClD,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,kBAAkB,CACvC,MAAM,EACN,IAAI,IAAI,EAAE,EACV;QACC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE;QAC3F,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;KAC1M,EACD,IAAI,EACJ,EAAE,CACF,CAAC;;AAMH,yDAAyD;AACzD,MAAM,UAAU,QAAQ,CAAC,IAAY;IACpC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,MAA8B,EAAE,MAA8B;IACxG,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,gBAAgB,CAAC,CAAA;AACpC,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC7C,OAAO,KAAK,CAAA;AACb,CAAC;AAED,2BAA2B;AAC3B,MAAM,MAAM;IACJ,IAAI,CAAC,IAAY;QACvB,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;IAChC,CAAC;CACD"}
@@ -0,0 +1,2 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ export declare function rootCleanPath(s: string, prefix: $.Slice<string>, suffix: $.Slice<string>): [string, $.GoError];
@@ -0,0 +1,4 @@
1
+ export function rootCleanPath(s, prefix, suffix) {
2
+ return [s, null];
3
+ }
4
+ //# sourceMappingURL=root_nonwindows.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root_nonwindows.gs.js","sourceRoot":"","sources":["../../../gs/os/root_nonwindows.gs.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,CAAS,EAAE,MAAuB,EAAE,MAAuB;IACxF,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACjB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { Root } from "./root_js.gs.js";
3
+ import { File } from "./types_js.gs.js";
4
+ import * as fs from "@goscript/io/fs/index.js";
5
+ export declare function openRootNolog(name: string): [Root | null, $.GoError];
6
+ export declare function openRootInRoot(r: Root | null, name: string): [Root | null, $.GoError];
7
+ export declare function newRoot(name: string): [Root | null, $.GoError];
8
+ export declare function rootOpenFileNolog(r: Root | null, name: string, flag: number, perm: number): [File | null, $.GoError];
9
+ export declare function rootStat(r: Root | null, name: string, lstat: boolean): [fs.FileInfo | null, $.GoError];
10
+ export declare function rootMkdir(r: Root | null, name: string, perm: number): $.GoError;
11
+ export declare function rootRemove(r: Root | null, name: string): $.GoError;
@@ -0,0 +1,31 @@
1
+ import { ErrUnimplemented } from "./error.gs.js";
2
+ // Stub functions for JavaScript environment - these operations cannot be implemented properly
3
+ // openRootNolog is OpenRoot - stub implementation
4
+ export function openRootNolog(name) {
5
+ return [null, ErrUnimplemented];
6
+ }
7
+ // openRootInRoot is Root.OpenRoot - stub implementation
8
+ export function openRootInRoot(r, name) {
9
+ return [null, ErrUnimplemented];
10
+ }
11
+ // newRoot returns a new Root - stub implementation
12
+ export function newRoot(name) {
13
+ return [null, ErrUnimplemented];
14
+ }
15
+ // rootOpenFileNolog is Root.OpenFile - stub implementation
16
+ export function rootOpenFileNolog(r, name, flag, perm) {
17
+ return [null, ErrUnimplemented];
18
+ }
19
+ // rootStat - stub implementation
20
+ export function rootStat(r, name, lstat) {
21
+ return [null, ErrUnimplemented];
22
+ }
23
+ // rootMkdir - stub implementation
24
+ export function rootMkdir(r, name, perm) {
25
+ return ErrUnimplemented;
26
+ }
27
+ // rootRemove - stub implementation
28
+ export function rootRemove(r, name) {
29
+ return ErrUnimplemented;
30
+ }
31
+ //# sourceMappingURL=root_noopenat.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root_noopenat.gs.js","sourceRoot":"","sources":["../../../gs/os/root_noopenat.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAOlE,8FAA8F;AAE9F,kDAAkD;AAClD,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,CAAc,EAAE,IAAY;IAC1D,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,OAAO,CAAC,IAAY;IACnC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,iBAAiB,CAAC,CAAc,EAAE,IAAY,EAAE,IAAY,EAAE,IAAY;IACzF,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,QAAQ,CAAC,CAAc,EAAE,IAAY,EAAE,KAAc;IACpE,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,SAAS,CAAC,CAAc,EAAE,IAAY,EAAE,IAAY;IACnE,OAAO,gBAAgB,CAAA;AACxB,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,UAAU,CAAC,CAAc,EAAE,IAAY;IACtD,OAAO,gBAAgB,CAAA;AACxB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import { Time, FileMode } from "./types_js.gs.js";
3
+ export declare function Stat(name: string): [
4
+ null | {
5
+ IsDir(): boolean;
6
+ ModTime(): any;
7
+ Mode(): any;
8
+ Name(): string;
9
+ Size(): number;
10
+ Sys(): null | any;
11
+ },
12
+ $.GoError
13
+ ];
14
+ export declare function Lstat(name: string): [
15
+ null | {
16
+ IsDir(): boolean;
17
+ ModTime(): Time;
18
+ Mode(): FileMode;
19
+ Name(): string;
20
+ Size(): number;
21
+ Sys(): null | any;
22
+ },
23
+ $.GoError
24
+ ];
@@ -0,0 +1,20 @@
1
+ import { lstatNolog, statNolog } from "./stat_js.gs.js";
2
+ // Stat returns a [FileInfo] describing the named file.
3
+ // If there is an error, it will be of type [*PathError].
4
+ export function Stat(name) {
5
+ // testlog.Stat(name) // Testlog not available in JavaScript
6
+ return statNolog(name);
7
+ }
8
+ // Lstat returns a [FileInfo] describing the named file.
9
+ // If the file is a symbolic link, the returned FileInfo
10
+ // describes the symbolic link. Lstat makes no attempt to follow the link.
11
+ // If there is an error, it will be of type [*PathError].
12
+ //
13
+ // On Windows, if the file is a reparse point that is a surrogate for another
14
+ // named entity (such as a symbolic link or mounted folder), the returned
15
+ // FileInfo describes the reparse point, and makes no attempt to resolve it.
16
+ export function Lstat(name) {
17
+ // testlog.Stat(name) // Testlog not available in JavaScript
18
+ return lstatNolog(name);
19
+ }
20
+ //# sourceMappingURL=stat.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.gs.js","sourceRoot":"","sources":["../../../gs/os/stat.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGxD,uDAAuD;AACvD,yDAAyD;AACzD,MAAM,UAAU,IAAI,CAAC,IAAY;IAQhC,4DAA4D;IAC5D,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC;AAED,wDAAwD;AACxD,wDAAwD;AACxD,0EAA0E;AAC1E,yDAAyD;AACzD,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,MAAM,UAAU,KAAK,CAAC,IAAY;IAQjC,4DAA4D;IAC5D,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import * as fs from "@goscript/io/fs/index.js";
3
+ export declare function Stat(name: string): [fs.FileInfo, $.GoError];
4
+ export declare function Lstat(name: string): [fs.FileInfo, $.GoError];
5
+ export declare function statNolog(name: string): [fs.FileInfo, $.GoError];
6
+ export declare function lstatNolog(name: string): [fs.FileInfo, $.GoError];
@@ -0,0 +1,23 @@
1
+ import { ErrUnimplemented } from "./error.gs.js";
2
+ // JavaScript-specific stubs for stat operations
3
+ // Stat returns a [FileInfo] describing the named file.
4
+ // If there is an error, it will be of type [*PathError].
5
+ export function Stat(name) {
6
+ return [null, ErrUnimplemented];
7
+ }
8
+ // Lstat returns a [FileInfo] describing the named file.
9
+ // If the file is a symbolic link, the returned FileInfo
10
+ // describes the symbolic link. Lstat makes no attempt to follow the link.
11
+ // If there is an error, it will be of type [*PathError].
12
+ export function Lstat(name) {
13
+ return [null, ErrUnimplemented];
14
+ }
15
+ // statNolog is the same as Stat, for use in DirFS.
16
+ export function statNolog(name) {
17
+ return [null, ErrUnimplemented];
18
+ }
19
+ // lstatNolog is the same as Lstat, for use in DirFS.
20
+ export function lstatNolog(name) {
21
+ return [null, ErrUnimplemented];
22
+ }
23
+ //# sourceMappingURL=stat_js.gs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat_js.gs.js","sourceRoot":"","sources":["../../../gs/os/stat_js.gs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD,gDAAgD;AAEhD,uDAAuD;AACvD,yDAAyD;AACzD,MAAM,UAAU,IAAI,CAAC,IAAY;IAChC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,wDAAwD;AACxD,wDAAwD;AACxD,0EAA0E;AAC1E,yDAAyD;AACzD,MAAM,UAAU,KAAK,CAAC,IAAY;IACjC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,UAAU,CAAC,IAAY;IACtC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAA;AAChC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as $ from "@goscript/builtin/builtin.js";
2
+ import * as fs from "@goscript/io/fs/index.js";
3
+ export declare function statNolog(name: string): [fs.FileInfo | null, $.GoError];
4
+ export declare function lstatNolog(name: string): [fs.FileInfo | null, $.GoError];
5
+ export declare function fillFileStatFromSys(fs: any, name: string): void;
6
+ export interface fileStat {
7
+ sys: any;
8
+ }