goscript 0.0.40 → 0.0.42

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 (380) hide show
  1. package/compiler/analysis.go +173 -2
  2. package/compiler/compiler.go +14 -4
  3. package/compiler/expr-type.go +25 -0
  4. package/compiler/field.go +4 -4
  5. package/compiler/spec.go +1 -1
  6. package/compiler/stmt.go +118 -17
  7. package/compiler/type.go +19 -4
  8. package/dist/gs/builtin/builtin.d.ts +10 -8
  9. package/dist/gs/builtin/builtin.js +14 -53
  10. package/dist/gs/builtin/builtin.js.map +1 -1
  11. package/dist/gs/builtin/errors.d.ts +8 -0
  12. package/dist/gs/builtin/errors.js +18 -0
  13. package/dist/gs/builtin/errors.js.map +1 -0
  14. package/dist/gs/builtin/index.d.ts +7 -0
  15. package/dist/gs/builtin/index.js +7 -0
  16. package/dist/gs/builtin/index.js.map +1 -1
  17. package/dist/gs/builtin/slice.d.ts +5 -2
  18. package/dist/gs/builtin/slice.js +110 -77
  19. package/dist/gs/builtin/slice.js.map +1 -1
  20. package/dist/gs/bytes/buffer.gs.d.ts +1 -1
  21. package/dist/gs/bytes/buffer.gs.js +1 -1
  22. package/dist/gs/bytes/buffer.gs.js.map +1 -1
  23. package/dist/gs/bytes/bytes.gs.d.ts +1 -1
  24. package/dist/gs/bytes/bytes.gs.js +1 -1
  25. package/dist/gs/bytes/bytes.gs.js.map +1 -1
  26. package/dist/gs/bytes/iter.gs.d.ts +1 -1
  27. package/dist/gs/bytes/iter.gs.js +1 -1
  28. package/dist/gs/bytes/iter.gs.js.map +1 -1
  29. package/dist/gs/bytes/reader.gs.d.ts +1 -1
  30. package/dist/gs/bytes/reader.gs.js +1 -1
  31. package/dist/gs/bytes/reader.gs.js.map +1 -1
  32. package/dist/gs/context/context.d.ts +1 -1
  33. package/dist/gs/context/context.js +1 -1
  34. package/dist/gs/context/context.js.map +1 -1
  35. package/dist/gs/errors/errors.d.ts +1 -1
  36. package/dist/gs/errors/errors.js +3 -15
  37. package/dist/gs/errors/errors.js.map +1 -1
  38. package/dist/gs/github.com/pkg/errors/errors.d.ts +1 -1
  39. package/dist/gs/github.com/pkg/errors/errors.js +1 -1
  40. package/dist/gs/github.com/pkg/errors/errors.js.map +1 -1
  41. package/dist/gs/github.com/pkg/errors/go113.d.ts +1 -1
  42. package/dist/gs/github.com/pkg/errors/go113.js +1 -1
  43. package/dist/gs/github.com/pkg/errors/go113.js.map +1 -1
  44. package/dist/gs/github.com/pkg/errors/stack.d.ts +1 -1
  45. package/dist/gs/github.com/pkg/errors/stack.js +1 -1
  46. package/dist/gs/github.com/pkg/errors/stack.js.map +1 -1
  47. package/dist/gs/internal/byteorder/index.d.ts +1 -1
  48. package/dist/gs/internal/byteorder/index.js +1 -1
  49. package/dist/gs/internal/byteorder/index.js.map +1 -1
  50. package/dist/gs/internal/oserror/errors.d.ts +1 -1
  51. package/dist/gs/io/fs/format.js +1 -1
  52. package/dist/gs/io/fs/format.js.map +1 -1
  53. package/dist/gs/io/fs/fs.d.ts +1 -1
  54. package/dist/gs/io/fs/fs.js +1 -1
  55. package/dist/gs/io/fs/fs.js.map +1 -1
  56. package/dist/gs/io/fs/glob.d.ts +1 -1
  57. package/dist/gs/io/fs/glob.js +1 -1
  58. package/dist/gs/io/fs/glob.js.map +1 -1
  59. package/dist/gs/io/fs/readdir.d.ts +1 -1
  60. package/dist/gs/io/fs/readdir.js +1 -1
  61. package/dist/gs/io/fs/readdir.js.map +1 -1
  62. package/dist/gs/io/fs/readfile.d.ts +1 -1
  63. package/dist/gs/io/fs/readfile.js +1 -1
  64. package/dist/gs/io/fs/readfile.js.map +1 -1
  65. package/dist/gs/io/fs/stat.d.ts +1 -1
  66. package/dist/gs/io/fs/stat.js +1 -1
  67. package/dist/gs/io/fs/stat.js.map +1 -1
  68. package/dist/gs/io/fs/sub.d.ts +1 -1
  69. package/dist/gs/io/fs/sub.js +1 -1
  70. package/dist/gs/io/fs/sub.js.map +1 -1
  71. package/dist/gs/io/fs/walk.d.ts +1 -1
  72. package/dist/gs/io/fs/walk.js +1 -1
  73. package/dist/gs/io/fs/walk.js.map +1 -1
  74. package/dist/gs/io/io.d.ts +1 -1
  75. package/dist/gs/maps/iter.d.ts +1 -1
  76. package/dist/gs/maps/iter.js +1 -1
  77. package/dist/gs/maps/iter.js.map +1 -1
  78. package/dist/gs/maps/maps.d.ts +1 -1
  79. package/dist/gs/maps/maps.js +1 -1
  80. package/dist/gs/maps/maps.js.map +1 -1
  81. package/dist/gs/math/erfinv.gs.js +1 -1
  82. package/dist/gs/math/erfinv.gs.js.map +1 -1
  83. package/dist/gs/math/gamma.gs.js +1 -1
  84. package/dist/gs/math/gamma.gs.js.map +1 -1
  85. package/dist/gs/math/j0.gs.js +1 -1
  86. package/dist/gs/math/j0.gs.js.map +1 -1
  87. package/dist/gs/math/j1.gs.js +1 -1
  88. package/dist/gs/math/j1.gs.js.map +1 -1
  89. package/dist/gs/math/lgamma.gs.js +1 -1
  90. package/dist/gs/math/lgamma.gs.js.map +1 -1
  91. package/dist/gs/math/pow10.gs.js +1 -1
  92. package/dist/gs/math/pow10.gs.js.map +1 -1
  93. package/dist/gs/math/sin.gs.js +1 -1
  94. package/dist/gs/math/sin.gs.js.map +1 -1
  95. package/dist/gs/math/tan.gs.js +1 -1
  96. package/dist/gs/math/tan.gs.js.map +1 -1
  97. package/dist/gs/math/tanh.gs.js +1 -1
  98. package/dist/gs/math/tanh.gs.js.map +1 -1
  99. package/dist/gs/math/trig_reduce.gs.js +1 -1
  100. package/dist/gs/math/trig_reduce.gs.js.map +1 -1
  101. package/dist/gs/os/dir.gs.d.ts +1 -1
  102. package/dist/gs/os/dir_unix.gs.d.ts +1 -1
  103. package/dist/gs/os/dir_unix.gs.js +1 -1
  104. package/dist/gs/os/dir_unix.gs.js.map +1 -1
  105. package/dist/gs/os/dirent_js.gs.d.ts +1 -1
  106. package/dist/gs/os/env.gs.d.ts +1 -1
  107. package/dist/gs/os/env.gs.js +1 -1
  108. package/dist/gs/os/env.gs.js.map +1 -1
  109. package/dist/gs/os/error.gs.d.ts +1 -1
  110. package/dist/gs/os/error.gs.js +1 -1
  111. package/dist/gs/os/error.gs.js.map +1 -1
  112. package/dist/gs/os/exec.gs.d.ts +1 -1
  113. package/dist/gs/os/exec.gs.js +1 -1
  114. package/dist/gs/os/exec.gs.js.map +1 -1
  115. package/dist/gs/os/exec_posix.gs.d.ts +1 -1
  116. package/dist/gs/os/exec_posix.gs.js +1 -1
  117. package/dist/gs/os/exec_posix.gs.js.map +1 -1
  118. package/dist/gs/os/exec_unix.gs.d.ts +1 -1
  119. package/dist/gs/os/executable.gs.d.ts +1 -1
  120. package/dist/gs/os/executable_js.gs.d.ts +1 -1
  121. package/dist/gs/os/executable_wasm.gs.d.ts +1 -1
  122. package/dist/gs/os/file_constants_js.gs.d.ts +1 -1
  123. package/dist/gs/os/file_constants_js.gs.js +1 -1
  124. package/dist/gs/os/file_constants_js.gs.js.map +1 -1
  125. package/dist/gs/os/file_js.gs.d.ts +1 -1
  126. package/dist/gs/os/file_open_unix.gs.d.ts +1 -1
  127. package/dist/gs/os/file_posix_js.gs.d.ts +1 -1
  128. package/dist/gs/os/file_unix_js.gs.d.ts +1 -1
  129. package/dist/gs/os/getwd_js.gs.d.ts +1 -1
  130. package/dist/gs/os/path.gs.d.ts +1 -1
  131. package/dist/gs/os/path.gs.js +1 -1
  132. package/dist/gs/os/path.gs.js.map +1 -1
  133. package/dist/gs/os/path_unix.gs.js +1 -1
  134. package/dist/gs/os/path_unix.gs.js.map +1 -1
  135. package/dist/gs/os/pidfd_js.gs.d.ts +1 -1
  136. package/dist/gs/os/pipe_wasm.gs.d.ts +1 -1
  137. package/dist/gs/os/proc.gs.d.ts +1 -1
  138. package/dist/gs/os/proc.gs.js +1 -1
  139. package/dist/gs/os/proc.gs.js.map +1 -1
  140. package/dist/gs/os/proc_js.gs.d.ts +1 -1
  141. package/dist/gs/os/proc_js.gs.js +1 -1
  142. package/dist/gs/os/proc_js.gs.js.map +1 -1
  143. package/dist/gs/os/rawconn_js.gs.d.ts +1 -1
  144. package/dist/gs/os/removeall_js.gs.d.ts +1 -1
  145. package/dist/gs/os/root_js.gs.d.ts +1 -1
  146. package/dist/gs/os/root_js.gs.js +1 -1
  147. package/dist/gs/os/root_js.gs.js.map +1 -1
  148. package/dist/gs/os/root_nonwindows.gs.d.ts +1 -1
  149. package/dist/gs/os/root_noopenat.gs.d.ts +1 -1
  150. package/dist/gs/os/stat.gs.d.ts +1 -1
  151. package/dist/gs/os/stat_js.gs.d.ts +1 -1
  152. package/dist/gs/os/stat_unix_js.gs.d.ts +1 -1
  153. package/dist/gs/os/sys.gs.d.ts +1 -1
  154. package/dist/gs/os/sys_bsd.gs.d.ts +1 -1
  155. package/dist/gs/os/sys_js.gs.d.ts +1 -1
  156. package/dist/gs/os/tempfile.gs.d.ts +1 -1
  157. package/dist/gs/os/types.gs.d.ts +1 -1
  158. package/dist/gs/os/types.gs.js +1 -1
  159. package/dist/gs/os/types.gs.js.map +1 -1
  160. package/dist/gs/os/types_js.gs.d.ts +1 -1
  161. package/dist/gs/os/types_js.gs.js +1 -1
  162. package/dist/gs/os/types_js.gs.js.map +1 -1
  163. package/dist/gs/os/types_unix.gs.d.ts +1 -1
  164. package/dist/gs/os/types_unix.gs.js +1 -1
  165. package/dist/gs/os/types_unix.gs.js.map +1 -1
  166. package/dist/gs/os/zero_copy_posix.gs.d.ts +1 -1
  167. package/dist/gs/os/zero_copy_posix.gs.js +1 -1
  168. package/dist/gs/os/zero_copy_posix.gs.js.map +1 -1
  169. package/dist/gs/path/filepath/path.d.ts +11 -10
  170. package/dist/gs/path/filepath/path.js +5 -4
  171. package/dist/gs/path/filepath/path.js.map +1 -1
  172. package/dist/gs/path/match.d.ts +1 -1
  173. package/dist/gs/path/match.js +1 -1
  174. package/dist/gs/path/match.js.map +1 -1
  175. package/dist/gs/path/path.js +1 -1
  176. package/dist/gs/path/path.js.map +1 -1
  177. package/dist/gs/reflect/value.d.ts +1 -1
  178. package/dist/gs/reflect/value.js +1 -1
  179. package/dist/gs/reflect/value.js.map +1 -1
  180. package/dist/gs/reflect/visiblefields.d.ts +1 -1
  181. package/dist/gs/reflect/visiblefields.js +1 -1
  182. package/dist/gs/reflect/visiblefields.js.map +1 -1
  183. package/dist/gs/slices/slices.d.ts +1 -1
  184. package/dist/gs/slices/slices.js +1 -1
  185. package/dist/gs/slices/slices.js.map +1 -1
  186. package/dist/gs/sort/search.gs.d.ts +1 -1
  187. package/dist/gs/sort/search.gs.js +1 -1
  188. package/dist/gs/sort/search.gs.js.map +1 -1
  189. package/dist/gs/sort/slice.gs.d.ts +1 -1
  190. package/dist/gs/sort/slice.gs.js +1 -1
  191. package/dist/gs/sort/slice.gs.js.map +1 -1
  192. package/dist/gs/sort/sort.gs.d.ts +1 -1
  193. package/dist/gs/sort/sort.gs.js +1 -1
  194. package/dist/gs/sort/sort.gs.js.map +1 -1
  195. package/dist/gs/strconv/atob.gs.d.ts +1 -1
  196. package/dist/gs/strconv/atob.gs.js +1 -1
  197. package/dist/gs/strconv/atob.gs.js.map +1 -1
  198. package/dist/gs/strconv/atof.gs.d.ts +1 -1
  199. package/dist/gs/strconv/atoi.gs.d.ts +1 -1
  200. package/dist/gs/strconv/atoi.gs.js +5 -6
  201. package/dist/gs/strconv/atoi.gs.js.map +1 -1
  202. package/dist/gs/strconv/ftoa.gs.d.ts +1 -1
  203. package/dist/gs/strconv/ftoa.gs.js +1 -1
  204. package/dist/gs/strconv/ftoa.gs.js.map +1 -1
  205. package/dist/gs/strconv/itoa.gs.d.ts +1 -1
  206. package/dist/gs/strconv/itoa.gs.js +1 -1
  207. package/dist/gs/strconv/itoa.gs.js.map +1 -1
  208. package/dist/gs/strconv/quote.gs.d.ts +1 -1
  209. package/dist/gs/strconv/quote.gs.js +1 -1
  210. package/dist/gs/strconv/quote.gs.js.map +1 -1
  211. package/dist/gs/strings/builder.d.ts +1 -1
  212. package/dist/gs/strings/builder.js +1 -1
  213. package/dist/gs/strings/builder.js.map +1 -1
  214. package/dist/gs/strings/iter.js +1 -1
  215. package/dist/gs/strings/iter.js.map +1 -1
  216. package/dist/gs/strings/reader.d.ts +1 -1
  217. package/dist/gs/strings/reader.js +7 -8
  218. package/dist/gs/strings/reader.js.map +1 -1
  219. package/dist/gs/strings/replace.d.ts +1 -1
  220. package/dist/gs/strings/replace.js +1 -1
  221. package/dist/gs/strings/replace.js.map +1 -1
  222. package/dist/gs/strings/strings.d.ts +1 -1
  223. package/dist/gs/strings/strings.js +1 -1
  224. package/dist/gs/strings/strings.js.map +1 -1
  225. package/dist/gs/sync/atomic/doc.gs.d.ts +1 -1
  226. package/dist/gs/sync/atomic/doc_64.gs.d.ts +1 -1
  227. package/dist/gs/sync/atomic/type.gs.d.ts +1 -1
  228. package/dist/gs/sync/atomic/type.gs.js +1 -1
  229. package/dist/gs/sync/atomic/type.gs.js.map +1 -1
  230. package/dist/gs/sync/atomic/value.gs.d.ts +1 -1
  231. package/dist/gs/sync/atomic/value.gs.js +1 -1
  232. package/dist/gs/sync/atomic/value.gs.js.map +1 -1
  233. package/dist/gs/syscall/index.d.ts +1 -1
  234. package/dist/gs/syscall/index.js +1 -1
  235. package/dist/gs/syscall/index.js.map +1 -1
  236. package/dist/gs/unicode/utf8/utf8.d.ts +1 -1
  237. package/dist/gs/unicode/utf8/utf8.js +1 -1
  238. package/dist/gs/unicode/utf8/utf8.js.map +1 -1
  239. package/gs/builtin/builtin.ts +16 -64
  240. package/gs/builtin/errors.ts +25 -0
  241. package/gs/builtin/index.ts +7 -0
  242. package/gs/builtin/slice.ts +125 -70
  243. package/gs/bytes/buffer.gs.ts +1 -1
  244. package/gs/bytes/bytes.gs.ts +1 -1
  245. package/gs/bytes/iter.gs.ts +1 -1
  246. package/gs/bytes/reader.gs.ts +1 -1
  247. package/gs/context/context.ts +1 -1
  248. package/gs/errors/errors.ts +3 -16
  249. package/gs/github.com/pkg/errors/errors.ts +1 -1
  250. package/gs/github.com/pkg/errors/go113.ts +2 -2
  251. package/gs/github.com/pkg/errors/stack.ts +1 -1
  252. package/gs/internal/byteorder/index.ts +1 -1
  253. package/gs/internal/oserror/errors.ts +1 -1
  254. package/gs/io/fs/format.ts +1 -1
  255. package/gs/io/fs/fs.ts +1 -1
  256. package/gs/io/fs/glob.ts +1 -1
  257. package/gs/io/fs/readdir.ts +1 -1
  258. package/gs/io/fs/readfile.ts +1 -1
  259. package/gs/io/fs/stat.ts +1 -1
  260. package/gs/io/fs/sub.ts +1 -1
  261. package/gs/io/fs/walk.ts +1 -1
  262. package/gs/io/io.ts +1 -1
  263. package/gs/maps/iter.ts +1 -1
  264. package/gs/maps/maps.ts +1 -1
  265. package/gs/math/abs.gs.ts +1 -1
  266. package/gs/math/acosh.gs.ts +1 -1
  267. package/gs/math/asinh.gs.ts +1 -1
  268. package/gs/math/atan.gs.ts +1 -1
  269. package/gs/math/atan2.gs.ts +1 -1
  270. package/gs/math/atanh.gs.ts +1 -1
  271. package/gs/math/bits.gs.ts +1 -1
  272. package/gs/math/cbrt.gs.ts +1 -1
  273. package/gs/math/const.gs.ts +1 -1
  274. package/gs/math/copysign.gs.ts +1 -1
  275. package/gs/math/dim.gs.ts +1 -1
  276. package/gs/math/erf.gs.ts +1 -1
  277. package/gs/math/erfinv.gs.ts +1 -1
  278. package/gs/math/exp.gs.ts +1 -1
  279. package/gs/math/expm1.gs.ts +1 -1
  280. package/gs/math/floor.gs.ts +1 -1
  281. package/gs/math/frexp.gs.ts +1 -1
  282. package/gs/math/gamma.gs.ts +1 -1
  283. package/gs/math/hypot.gs.ts +1 -1
  284. package/gs/math/j0.gs.ts +1 -1
  285. package/gs/math/j1.gs.ts +1 -1
  286. package/gs/math/jn.gs.ts +1 -1
  287. package/gs/math/ldexp.gs.ts +1 -1
  288. package/gs/math/lgamma.gs.ts +1 -1
  289. package/gs/math/log.gs.ts +1 -1
  290. package/gs/math/log10.gs.ts +1 -1
  291. package/gs/math/log1p.gs.ts +1 -1
  292. package/gs/math/logb.gs.ts +1 -1
  293. package/gs/math/mod.gs.ts +1 -1
  294. package/gs/math/modf.gs.ts +1 -1
  295. package/gs/math/nextafter.gs.ts +1 -1
  296. package/gs/math/pow.gs.ts +1 -1
  297. package/gs/math/pow10.gs.ts +1 -1
  298. package/gs/math/remainder.gs.ts +1 -1
  299. package/gs/math/signbit.gs.ts +1 -1
  300. package/gs/math/sin.gs.ts +1 -1
  301. package/gs/math/sincos.gs.ts +1 -1
  302. package/gs/math/sinh.gs.ts +1 -1
  303. package/gs/math/sqrt.gs.ts +1 -1
  304. package/gs/math/tan.gs.ts +1 -1
  305. package/gs/math/tanh.gs.ts +1 -1
  306. package/gs/math/trig_reduce.gs.ts +1 -1
  307. package/gs/math/unsafe.gs.ts +1 -1
  308. package/gs/os/dir.gs.ts +1 -1
  309. package/gs/os/dir_unix.gs.ts +1 -1
  310. package/gs/os/dirent_js.gs.ts +1 -1
  311. package/gs/os/env.gs.ts +1 -1
  312. package/gs/os/error.gs.ts +1 -1
  313. package/gs/os/error_errno.gs.ts +1 -1
  314. package/gs/os/exec.gs.ts +1 -1
  315. package/gs/os/exec_nohandle.gs.ts +1 -1
  316. package/gs/os/exec_posix.gs.ts +1 -1
  317. package/gs/os/exec_unix.gs.ts +1 -1
  318. package/gs/os/executable.gs.ts +1 -1
  319. package/gs/os/executable_js.gs.ts +1 -1
  320. package/gs/os/executable_wasm.gs.ts +1 -1
  321. package/gs/os/file_constants_js.gs.ts +1 -1
  322. package/gs/os/file_js.gs.ts +1 -1
  323. package/gs/os/file_open_unix.gs.ts +1 -1
  324. package/gs/os/file_posix_js.gs.ts +1 -1
  325. package/gs/os/file_unix_js.gs.ts +1 -1
  326. package/gs/os/getwd_js.gs.ts +1 -1
  327. package/gs/os/path.gs.ts +1 -1
  328. package/gs/os/path_unix.gs.ts +1 -1
  329. package/gs/os/pidfd_js.gs.ts +1 -1
  330. package/gs/os/pipe_wasm.gs.ts +1 -1
  331. package/gs/os/proc.gs.ts +1 -1
  332. package/gs/os/proc_js.gs.ts +1 -1
  333. package/gs/os/rawconn_js.gs.ts +1 -1
  334. package/gs/os/removeall_js.gs.ts +1 -1
  335. package/gs/os/root_js.gs.ts +1 -1
  336. package/gs/os/root_nonwindows.gs.ts +1 -1
  337. package/gs/os/root_noopenat.gs.ts +1 -1
  338. package/gs/os/stat.gs.ts +1 -1
  339. package/gs/os/stat_js.gs.ts +1 -1
  340. package/gs/os/stat_unix_js.gs.ts +1 -1
  341. package/gs/os/sticky_bsd.gs.ts +1 -1
  342. package/gs/os/sys.gs.ts +1 -1
  343. package/gs/os/sys_bsd.gs.ts +1 -1
  344. package/gs/os/sys_js.gs.ts +1 -1
  345. package/gs/os/tempfile.gs.ts +1 -1
  346. package/gs/os/types.gs.ts +1 -1
  347. package/gs/os/types_js.gs.ts +1 -1
  348. package/gs/os/types_unix.gs.ts +1 -1
  349. package/gs/os/wait_unimp.gs.ts +1 -1
  350. package/gs/os/zero_copy_posix.gs.ts +1 -1
  351. package/gs/os/zero_copy_stub.gs.ts +1 -1
  352. package/gs/path/filepath/path.ts +14 -13
  353. package/gs/path/match.ts +1 -1
  354. package/gs/path/path.ts +1 -1
  355. package/gs/reflect/value.ts +1 -1
  356. package/gs/reflect/visiblefields.ts +1 -1
  357. package/gs/slices/slices.ts +1 -1
  358. package/gs/sort/search.gs.ts +1 -1
  359. package/gs/sort/slice.gs.ts +1 -1
  360. package/gs/sort/sort.gs.ts +1 -1
  361. package/gs/strconv/atob.gs.ts +1 -1
  362. package/gs/strconv/atof.gs.ts +1 -1
  363. package/gs/strconv/atoi.gs.ts +5 -6
  364. package/gs/strconv/doc.gs.ts +1 -1
  365. package/gs/strconv/ftoa.gs.ts +1 -1
  366. package/gs/strconv/itoa.gs.ts +1 -1
  367. package/gs/strconv/quote.gs.ts +1 -1
  368. package/gs/strings/builder.ts +1 -1
  369. package/gs/strings/iter.ts +1 -1
  370. package/gs/strings/reader.ts +7 -9
  371. package/gs/strings/replace.ts +1 -1
  372. package/gs/strings/strings.ts +1 -1
  373. package/gs/sync/atomic/doc.gs.ts +1 -1
  374. package/gs/sync/atomic/doc_64.gs.ts +1 -1
  375. package/gs/sync/atomic/type.gs.ts +1 -1
  376. package/gs/sync/atomic/value.gs.ts +1 -1
  377. package/gs/syscall/index.ts +1 -1
  378. package/gs/unicode/utf8/utf8.ts +1 -1
  379. package/package.json +3 -3
  380. package/gs/builtin/io.ts +0 -22
@@ -1,13 +1,22 @@
1
- export * from './varRef.js'
2
- export * from './channel.js'
3
- export * from './defer.js'
4
- export * from './io.js'
5
- export * from './map.js'
6
- export * from './slice.js'
7
- export * from './type.js'
8
1
  import type { Slice, SliceProxy } from './slice.js'
9
2
  import { isSliceProxy } from './slice.js'
10
3
 
4
+ /**
5
+ * Implementation of Go's built-in println function
6
+ * @param args Arguments to print
7
+ */
8
+ export function println(...args: any[]): void {
9
+ console.log(...args)
10
+ }
11
+
12
+ /**
13
+ * Implementation of Go's built-in panic function
14
+ * @param args Arguments passed to panic
15
+ */
16
+ export function panic(...args: any[]): void {
17
+ throw new Error(`panic: ${args.map((arg) => String(arg)).join(' ')}`)
18
+ }
19
+
11
20
  // Bytes represents all valid []byte representations in TypeScript
12
21
  // This includes Uint8Array (the preferred representation) and $.Slice<number> (which includes null)
13
22
  export type Bytes = Uint8Array | Slice<number>
@@ -25,63 +34,6 @@ export function int(value: number): number {
25
34
  return Math.trunc(value)
26
35
  }
27
36
 
28
- // Copy is the Go builtin function that copies the contents of one slice to another.
29
- // It returns the number of elements copied.
30
- export function copy<T>(
31
- dst: T[] | Uint8Array,
32
- src: T[] | Uint8Array | string,
33
- ): number {
34
- // Handle string to Uint8Array copy (common in Go)
35
- if (typeof src === 'string' && dst instanceof Uint8Array) {
36
- const encoder = new TextEncoder()
37
- const srcBytes = encoder.encode(src)
38
- const n = Math.min(dst.length, srcBytes.length)
39
- for (let i = 0; i < n; i++) {
40
- dst[i] = srcBytes[i]
41
- }
42
- return n
43
- }
44
-
45
- // Handle Uint8Array to Uint8Array copy
46
- if (dst instanceof Uint8Array && src instanceof Uint8Array) {
47
- const n = Math.min(dst.length, src.length)
48
- for (let i = 0; i < n; i++) {
49
- dst[i] = src[i]
50
- }
51
- return n
52
- }
53
-
54
- // Handle array to array copy (original implementation)
55
- if (Array.isArray(dst) && Array.isArray(src)) {
56
- const n = Math.min(dst.length, src.length)
57
- for (let i = 0; i < n; i++) {
58
- dst[i] = src[i]
59
- }
60
- return n
61
- }
62
-
63
- // Handle mixed types - convert to compatible format
64
- if (dst instanceof Uint8Array && Array.isArray(src)) {
65
- const n = Math.min(dst.length, src.length)
66
- for (let i = 0; i < n; i++) {
67
- dst[i] = src[i] as number
68
- }
69
- return n
70
- }
71
-
72
- if (Array.isArray(dst) && src instanceof Uint8Array) {
73
- const n = Math.min(dst.length, src.length)
74
- for (let i = 0; i < n; i++) {
75
- dst[i] = src[i] as T
76
- }
77
- return n
78
- }
79
-
80
- throw new Error(
81
- `Unsupported copy operation between ${typeof dst} and ${typeof src}`,
82
- )
83
- }
84
-
85
37
  // Duration multiplication helper for time package operations
86
38
  // Handles expressions like time.Hour * 24
87
39
  export function multiplyDuration(duration: any, multiplier: number): any {
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Represents the Go error type (interface).
3
+ */
4
+ export type GoError = {
5
+ Error(): string
6
+ } | null
7
+
8
+ // newError creates a new Go error with the given message
9
+ export function newError(text: string): GoError {
10
+ return {
11
+ Error: () => text,
12
+ }
13
+ }
14
+
15
+ // toGoError converts a JavaScript Error to a Go error
16
+ // if the error is already a Go error, it returns it unchanged
17
+ export function toGoError(err: Error): GoError {
18
+ if ("Error" in err) {
19
+ return err as GoError
20
+ }
21
+ return {
22
+ JsError: err,
23
+ Error: () => err.message,
24
+ } as GoError
25
+ }
@@ -1 +1,8 @@
1
1
  export * from './builtin.js'
2
+ export * from './slice.js'
3
+ export * from './channel.js'
4
+ export * from './map.js'
5
+ export * from './type.js'
6
+ export * from './varRef.js'
7
+ export * from './defer.js'
8
+ export * from './errors.js'
@@ -816,97 +816,152 @@ export function append<T>(
816
816
  /**
817
817
  * Copies elements from src to dst.
818
818
  * @param dst The destination slice.
819
- * @param src The source slice.
819
+ * @param src The source slice or string.
820
820
  * @returns The number of elements copied.
821
821
  */
822
- export const copy = <T>(dst: Slice<T>, src: Slice<T>): number => {
823
- if (dst === null || src === null) {
822
+ export function copy(dst: Uint8Array, src: Uint8Array | string): number
823
+ export function copy(dst: Uint8Array, src: Slice<number>): number
824
+ export function copy<T>(dst: Slice<T>, src: Slice<T>): number
825
+ export function copy<T>(dst: Slice<T>, src: string): number
826
+ export function copy<T>(dst: Slice<T> | Uint8Array, src: Slice<T> | Uint8Array | string): number {
827
+ if (dst === null) {
824
828
  return 0
825
829
  }
826
830
 
827
- const dstLen = len(dst)
828
- const srcLen = len(src)
831
+ // Handle string source first
832
+ if (typeof src === 'string') {
833
+ return copyFromString(dst, src)
834
+ }
835
+
836
+ if (src === null) {
837
+ return 0
838
+ }
839
+
840
+ // Now we know src is Slice<T> | Uint8Array
841
+ const dstLen = dst instanceof Uint8Array ? dst.length : len(dst)
842
+ const srcLen = src instanceof Uint8Array ? src.length : len(src)
829
843
  const count = Math.min(dstLen, srcLen)
830
844
 
831
845
  if (count === 0) {
832
846
  return 0
833
847
  }
834
848
 
835
- const isDstUint8Array = dst instanceof Uint8Array
836
- const isSrcUint8Array = src instanceof Uint8Array
849
+ // Handle all combinations of dst and src types
850
+ if (dst instanceof Uint8Array && src instanceof Uint8Array) {
851
+ // Uint8Array to Uint8Array
852
+ dst.set(src.subarray(0, count))
853
+ return count
854
+ }
855
+
856
+ if (dst instanceof Uint8Array) {
857
+ // Uint8Array destination, Slice<number> source
858
+ return copyToUint8Array(dst, src as Slice<number>, count)
859
+ }
837
860
 
838
- if (isDstUint8Array && isSrcUint8Array) {
839
- ;(dst as Uint8Array).set((src as Uint8Array).subarray(0, count))
840
- } else if (isDstUint8Array) {
841
- // dst is Uint8Array, src is Slice<number> or number[]
842
- const dstUint8 = dst as Uint8Array
861
+ if (src instanceof Uint8Array) {
862
+ // Slice<T> destination, Uint8Array source
863
+ return copyFromUint8Array(dst as Slice<T>, src, count)
864
+ }
865
+
866
+ // Both are Slice<T>
867
+ return copyBetweenSlices(dst as Slice<T>, src as Slice<T>, count)
868
+ }
869
+
870
+ /**
871
+ * Helper: Copy from string to any destination type
872
+ */
873
+ function copyFromString<T>(dst: Slice<T> | Uint8Array, src: string): number {
874
+ const encoder = new TextEncoder()
875
+ const srcBytes = encoder.encode(src)
876
+ const dstLen = dst instanceof Uint8Array ? dst.length : len(dst)
877
+ const count = Math.min(dstLen, srcBytes.length)
878
+
879
+ if (count === 0) {
880
+ return 0
881
+ }
882
+
883
+ if (dst instanceof Uint8Array) {
884
+ for (let i = 0; i < count; i++) {
885
+ dst[i] = srcBytes[i]
886
+ }
887
+ } else if (isComplexSlice(dst)) {
888
+ const dstMeta = dst.__meta__
889
+ for (let i = 0; i < count; i++) {
890
+ dstMeta.backing[dstMeta.offset + i] = srcBytes[i] as unknown as T
891
+ ;(dst as any)[i] = srcBytes[i]
892
+ }
893
+ } else if (Array.isArray(dst)) {
894
+ for (let i = 0; i < count; i++) {
895
+ dst[i] = srcBytes[i] as unknown as T
896
+ }
897
+ }
898
+
899
+ return count
900
+ }
901
+
902
+ /**
903
+ * Helper: Copy from Slice<number> to Uint8Array
904
+ */
905
+ function copyToUint8Array(dst: Uint8Array, src: Slice<number>, count: number): number {
906
+ if (isComplexSlice(src)) {
907
+ const srcMeta = src.__meta__
908
+ for (let i = 0; i < count; i++) {
909
+ dst[i] = srcMeta.backing[srcMeta.offset + i]
910
+ }
911
+ } else if (Array.isArray(src)) {
912
+ for (let i = 0; i < count; i++) {
913
+ dst[i] = src[i]
914
+ }
915
+ }
916
+ return count
917
+ }
918
+
919
+ /**
920
+ * Helper: Copy from Uint8Array to Slice<T>
921
+ */
922
+ function copyFromUint8Array<T>(dst: Slice<T>, src: Uint8Array, count: number): number {
923
+ if (isComplexSlice(dst)) {
924
+ const dstMeta = dst.__meta__
925
+ for (let i = 0; i < count; i++) {
926
+ dstMeta.backing[dstMeta.offset + i] = src[i] as unknown as T
927
+ ;(dst as any)[i] = src[i]
928
+ }
929
+ } else if (Array.isArray(dst)) {
930
+ for (let i = 0; i < count; i++) {
931
+ dst[i] = src[i] as unknown as T
932
+ }
933
+ }
934
+ return count
935
+ }
936
+
937
+ /**
938
+ * Helper: Copy between two Slice<T> instances
939
+ */
940
+ function copyBetweenSlices<T>(dst: Slice<T>, src: Slice<T>, count: number): number {
941
+ if (isComplexSlice(dst)) {
942
+ const dstMeta = dst.__meta__
943
+
843
944
  if (isComplexSlice(src)) {
844
- const srcMeta = (src as SliceProxy<number>).__meta__
945
+ const srcMeta = src.__meta__
845
946
  for (let i = 0; i < count; i++) {
846
- dstUint8[i] = srcMeta.backing[srcMeta.offset + i]
947
+ dstMeta.backing[dstMeta.offset + i] = srcMeta.backing[srcMeta.offset + i]
948
+ ;(dst as any)[i] = srcMeta.backing[srcMeta.offset + i]
847
949
  }
848
- } else {
849
- // src is number[]
850
- const srcArray = src as number[]
950
+ } else if (Array.isArray(src)) {
851
951
  for (let i = 0; i < count; i++) {
852
- dstUint8[i] = srcArray[i]
952
+ dstMeta.backing[dstMeta.offset + i] = src[i]
953
+ ;(dst as any)[i] = src[i]
853
954
  }
854
955
  }
855
- } else if (isSrcUint8Array) {
856
- // src is Uint8Array, dst is Slice<number> or number[]
857
- const srcUint8 = src as Uint8Array
858
- if (isComplexSlice(dst)) {
859
- const dstMeta = (dst as SliceProxy<number>).__meta__
860
- const dstBacking = dstMeta.backing
861
- const dstOffset = dstMeta.offset
956
+ } else if (Array.isArray(dst)) {
957
+ if (isComplexSlice(src)) {
958
+ const srcMeta = src.__meta__
862
959
  for (let i = 0; i < count; i++) {
863
- dstBacking[dstOffset + i] = srcUint8[i]
864
- // Also update the proxy view if dst is a proxy
865
- ;(dst as any)[i] = srcUint8[i]
960
+ dst[i] = srcMeta.backing[srcMeta.offset + i]
866
961
  }
867
- } else {
868
- // dst is number[]
869
- const dstArray = dst as number[]
962
+ } else if (Array.isArray(src)) {
870
963
  for (let i = 0; i < count; i++) {
871
- dstArray[i] = srcUint8[i]
872
- }
873
- }
874
- } else {
875
- // Both are Slice<T> or T[] (original logic)
876
- if (isComplexSlice(dst)) {
877
- const dstOffset = (dst as SliceProxy<T>).__meta__.offset
878
- const dstBacking = (dst as SliceProxy<T>).__meta__.backing
879
-
880
- if (isComplexSlice(src)) {
881
- const srcOffset = (src as SliceProxy<T>).__meta__.offset
882
- const srcBacking = (src as SliceProxy<T>).__meta__.backing
883
- for (let i = 0; i < count; i++) {
884
- dstBacking[dstOffset + i] = srcBacking[srcOffset + i]
885
- ;(dst as any)[i] = srcBacking[srcOffset + i] // Update proxy
886
- }
887
- } else {
888
- // src is T[]
889
- const srcArray = src as T[]
890
- for (let i = 0; i < count; i++) {
891
- dstBacking[dstOffset + i] = srcArray[i]
892
- ;(dst as any)[i] = srcArray[i] // Update proxy
893
- }
894
- }
895
- } else {
896
- // dst is T[]
897
- const dstArray = dst as T[]
898
- if (isComplexSlice(src)) {
899
- const srcOffset = (src as SliceProxy<T>).__meta__.offset
900
- const srcBacking = (src as SliceProxy<T>).__meta__.backing
901
- for (let i = 0; i < count; i++) {
902
- dstArray[i] = srcBacking[srcOffset + i]
903
- }
904
- } else {
905
- // src is T[]
906
- const srcArray = src as T[]
907
- for (let i = 0; i < count; i++) {
908
- dstArray[i] = srcArray[i]
909
- }
964
+ dst[i] = src[i]
910
965
  }
911
966
  }
912
967
  }
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  const { copy, recover } = $;
3
3
 
4
4
  import { IndexByte } from "./bytes.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
 
3
3
 
4
4
  import * as unicode from "@goscript/unicode/index.js"
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Index, IndexByte, asciiSpace } from "./bytes.gs.js";
3
3
 
4
4
  import * as iter from "@goscript/iter/index.js"
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  const { copy } = $;
3
3
 
4
4
  import * as errors from "@goscript/errors/index.js"
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  export const Canceled = new Error('context canceled')
4
4
  Canceled.name = 'CanceledError'
@@ -1,22 +1,9 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
2
-
3
- // GoScriptError implements the Go error interface
4
- class GoScriptError {
5
- constructor(private message: string) {}
6
-
7
- Error(): string {
8
- return this.message
9
- }
10
-
11
- toString(): string {
12
- return this.message
13
- }
14
- }
1
+ import * as $ from '@goscript/builtin/index.js'
15
2
 
16
3
  // New returns an error that formats as the given text.
17
4
  // Each call to New returns a distinct error value even if the text is identical.
18
5
  export function New(text: string): $.GoError {
19
- return new GoScriptError(text)
6
+ return $.newError(text)
20
7
  }
21
8
 
22
9
  // ErrUnsupported indicates that a requested operation cannot be performed,
@@ -212,7 +199,7 @@ export function Join(...errs: $.GoError[]): $.GoError {
212
199
  }
213
200
 
214
201
  const message = nonNilErrs.map((err) => err!.Error()).join('\n')
215
- const joinedError = new GoScriptError(message)
202
+ const joinedError = $.newError(message)
216
203
 
217
204
  // Add Unwrap method that returns the array of errors
218
205
  ;(joinedError as any).Unwrap = function (): $.GoError[] {
@@ -1,4 +1,4 @@
1
- import * as $ from '../../../builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { callers } from './stack.js'
3
3
 
4
4
  // Type definitions
@@ -1,6 +1,6 @@
1
- import * as $ from '../../../builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
- import * as stderrors from '../../../errors/index.js'
3
+ import * as stderrors from '@goscript/errors/index.js'
4
4
 
5
5
  // Is reports whether any error in err's chain matches target.
6
6
  //
@@ -1,4 +1,4 @@
1
- import * as $ from '../../../builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  // Type definitions
4
4
  export type uintptr = number
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  // Stub implementations for internal/byteorder package
4
4
  export function LittleEndian(): boolean {
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  import * as errors from '@goscript/errors/index.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { FileInfo, DirEntry, fileModeString } from './fs.js'
3
3
 
4
4
  import * as time from '@goscript/time/index.js'
package/gs/io/fs/fs.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  import * as time from '@goscript/time/index.js'
4
4
 
package/gs/io/fs/glob.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { Stat } from './stat.js'
3
3
  import { ReadDir } from './readdir.js'
4
4
  import { FS } from './fs.js'
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { FormatDirEntry } from './format.js'
3
3
  import {
4
4
  FS,
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { FS } from './fs.js'
3
3
 
4
4
  import * as io from '@goscript/io/index.js'
package/gs/io/fs/stat.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { FS, FileInfo } from './fs.js'
3
3
 
4
4
  export type StatFS =
package/gs/io/fs/sub.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { ValidPath, FS, PathError, ErrInvalid, File, DirEntry } from './fs.js'
3
3
  import { ReadDir } from './readdir.js'
4
4
  import { ReadFile } from './readfile.js'
package/gs/io/fs/walk.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
  import { FileInfoToDirEntry, ReadDir } from './readdir.js'
3
3
  import { Stat } from './stat.js'
4
4
  import { FS, DirEntry } from './fs.js'
package/gs/io/io.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // such as those in package os, into shared public interfaces that abstract
4
4
  // the functionality, plus some other related primitives.
5
5
 
6
- import * as $ from '@goscript/builtin/builtin.js'
6
+ import * as $ from '@goscript/builtin/index.js'
7
7
 
8
8
  // Simple error implementation for io package
9
9
  class IOError {
package/gs/maps/iter.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  import * as iter from '@goscript/iter/index.js'
4
4
 
package/gs/maps/maps.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from '@goscript/builtin/builtin.js'
1
+ import * as $ from '@goscript/builtin/index.js'
2
2
 
3
3
  import * as _ from '@goscript/unsafe/index.js'
4
4
 
package/gs/math/abs.gs.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Float64bits, Float64frombits } from "./unsafe.gs.js";
3
3
 
4
4
  // Abs returns the absolute value of x.
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { IsNaN, NaN } from "./bits.gs.js";
3
3
  import { Log } from "./log.gs.js";
4
4
  import { Log1p } from "./log1p.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { IsInf, IsNaN } from "./bits.gs.js";
3
3
  import { Log } from "./log.gs.js";
4
4
  import { Log1p } from "./log1p.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
 
3
3
  // xatan evaluates a series valid in the range [0, 0.66].
4
4
  export function xatan(x: number): number {
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Atan } from "./atan.gs.js";
3
3
  import { IsInf, IsNaN, NaN } from "./bits.gs.js";
4
4
  import { Copysign } from "./copysign.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Inf, IsNaN, NaN } from "./bits.gs.js";
3
3
  import { Log1p } from "./log1p.gs.js";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Abs } from "./abs.gs.js";
3
3
  import { Float64frombits } from "./unsafe.gs.js";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { IsInf, IsNaN } from "./bits.gs.js";
3
3
 
4
4
  import { Float64bits, Float64frombits } from "./unsafe.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
 
3
3
  // https://oeis.org/A001113
4
4
  export let E: number = Math.E
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Float64bits, Float64frombits } from "./unsafe.gs.js";
3
3
 
4
4
  // Copysign returns a value with the magnitude of f
package/gs/math/dim.gs.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Inf, IsInf, IsNaN, NaN } from "./bits.gs.js";
3
3
  // archMax and archMin imports removed - using optimized implementation
4
4
  import { Signbit } from "./signbit.gs.js";
package/gs/math/erf.gs.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { IsInf, IsNaN, NaN } from "./bits.gs.js";
3
3
  import { Exp } from "./exp.gs.js";
4
4
 
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Inf, IsNaN, NaN } from "./bits.gs.js";
3
3
  import { Log } from "./log.gs.js";
4
4
  import { Sqrt } from "./sqrt.gs.js";
package/gs/math/exp.gs.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Inf, IsInf, IsNaN } from "./bits.gs.js";
3
3
  // archExp2 and archExp imports removed - using optimized implementation
4
4
  import { Ldexp } from "./ldexp.gs.js";
@@ -1,4 +1,4 @@
1
- import * as $ from "@goscript/builtin/builtin.js";
1
+ import * as $ from "@goscript/builtin/index.js";
2
2
  import { Inf, IsInf, IsNaN } from "./bits.gs.js";
3
3
 
4
4
  import { Float64bits, Float64frombits } from "./unsafe.gs.js";