@scriptc/cli-darwin-arm64 0.2.0 → 0.2.2

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 (260) hide show
  1. package/dist/THIRD_PARTY_NOTICES +1 -1
  2. package/dist/bin/scriptc +0 -0
  3. package/dist/bin/scriptc.json +1 -1
  4. package/dist/lib/declarations/scriptc-node-fallback.d.ts +84 -19
  5. package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
  6. package/dist/lib/llvm/package.json +1 -1
  7. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_array.o +0 -0
  8. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_assert.o +0 -0
  9. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_async.o +0 -0
  10. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_async_dyn.o +0 -0
  11. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bigint.o +0 -0
  12. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes.o +0 -0
  13. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
  14. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_child.o +0 -0
  15. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_console.o +0 -0
  16. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_console_native.o +0 -0
  17. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_crypto_async.o +0 -0
  18. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_dyn_invoke.o +0 -0
  19. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_error.o +0 -0
  20. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_events.o +0 -0
  21. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_exception.o +0 -0
  22. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_fetch.o +0 -0
  23. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
  24. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_grapheme.o +0 -0
  25. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_http.o +0 -0
  26. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_http2.o +0 -0
  27. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_json.o +0 -0
  28. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_lib.o +0 -0
  29. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_map.o +0 -0
  30. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_net.o +0 -0
  31. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_node_builtin.o +0 -0
  32. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_object.o +0 -0
  33. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_qs.o +0 -0
  34. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_regex.o +0 -0
  35. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_stream.o +0 -0
  36. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_string.o +0 -0
  37. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_symbol.o +0 -0
  38. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_url.o +0 -0
  39. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
  40. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
  41. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
  42. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_async_dyn.o +0 -0
  43. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bigint.o +0 -0
  44. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes.o +0 -0
  45. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
  46. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_child.o +0 -0
  47. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_console.o +0 -0
  48. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_console_native.o +0 -0
  49. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_crypto_async.o +0 -0
  50. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_dyn_invoke.o +0 -0
  51. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_error.o +0 -0
  52. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
  53. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
  54. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
  55. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_grapheme.o +0 -0
  56. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_http.o +0 -0
  57. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_http2.o +0 -0
  58. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
  59. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
  60. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
  61. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
  62. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_net.o +0 -0
  63. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_node_builtin.o +0 -0
  64. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_object.o +0 -0
  65. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_qs.o +0 -0
  66. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
  67. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_stream.o +0 -0
  68. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_string.o +0 -0
  69. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_symbol.o +0 -0
  70. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_url.o +0 -0
  71. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_web.o +0 -0
  72. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
  73. package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  74. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
  75. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
  76. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bigint.o +0 -0
  77. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes.o +0 -0
  78. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
  79. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_console_native.o +0 -0
  80. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_dyn_invoke.o +0 -0
  81. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_error.o +0 -0
  82. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
  83. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_grapheme.o +0 -0
  84. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
  85. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
  86. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
  87. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_node_builtin.o +0 -0
  88. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_object.o +0 -0
  89. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
  90. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_string.o +0 -0
  91. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_symbol.o +0 -0
  92. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_url.o +0 -0
  93. package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  94. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_array.o +0 -0
  95. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
  96. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bigint.o +0 -0
  97. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes.o +0 -0
  98. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
  99. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_console_native.o +0 -0
  100. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_dyn_invoke.o +0 -0
  101. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_error.o +0 -0
  102. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
  103. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_grapheme.o +0 -0
  104. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_json.o +0 -0
  105. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
  106. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_map.o +0 -0
  107. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_node_builtin.o +0 -0
  108. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_object.o +0 -0
  109. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
  110. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_string.o +0 -0
  111. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_symbol.o +0 -0
  112. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_url.o +0 -0
  113. package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  114. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
  115. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
  116. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bigint.o +0 -0
  117. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes.o +0 -0
  118. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
  119. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_console_native.o +0 -0
  120. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_dyn_invoke.o +0 -0
  121. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_error.o +0 -0
  122. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
  123. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_grapheme.o +0 -0
  124. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
  125. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
  126. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
  127. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_node_builtin.o +0 -0
  128. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_object.o +0 -0
  129. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
  130. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_string.o +0 -0
  131. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_symbol.o +0 -0
  132. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_url.o +0 -0
  133. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  134. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
  135. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
  136. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bigint.o +0 -0
  137. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes.o +0 -0
  138. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
  139. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_console_native.o +0 -0
  140. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_dyn_invoke.o +0 -0
  141. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_error.o +0 -0
  142. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
  143. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_grapheme.o +0 -0
  144. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
  145. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
  146. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
  147. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_node_builtin.o +0 -0
  148. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_object.o +0 -0
  149. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
  150. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_string.o +0 -0
  151. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_symbol.o +0 -0
  152. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_url.o +0 -0
  153. package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  154. package/dist/lib/runtime-darwin-arm64/artifacts/licenses/v8-number-radix.txt +61 -0
  155. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_array.o +0 -0
  156. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_assert.o +0 -0
  157. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_async.o +0 -0
  158. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_async_dyn.o +0 -0
  159. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bigint.o +0 -0
  160. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes.o +0 -0
  161. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
  162. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_child.o +0 -0
  163. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_console.o +0 -0
  164. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_console_native.o +0 -0
  165. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_crypto_async.o +0 -0
  166. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_dyn_invoke.o +0 -0
  167. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_error.o +0 -0
  168. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_events.o +0 -0
  169. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_exception.o +0 -0
  170. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_fetch.o +0 -0
  171. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
  172. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_grapheme.o +0 -0
  173. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_http.o +0 -0
  174. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_http2.o +0 -0
  175. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_json.o +0 -0
  176. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_lib.o +0 -0
  177. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_map.o +0 -0
  178. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_net.o +0 -0
  179. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_node_builtin.o +0 -0
  180. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_object.o +0 -0
  181. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_qs.o +0 -0
  182. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_regex.o +0 -0
  183. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_stream.o +0 -0
  184. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_string.o +0 -0
  185. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_symbol.o +0 -0
  186. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_url.o +0 -0
  187. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
  188. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
  189. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
  190. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_async_dyn.o +0 -0
  191. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bigint.o +0 -0
  192. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes.o +0 -0
  193. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
  194. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_child.o +0 -0
  195. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_console.o +0 -0
  196. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_console_native.o +0 -0
  197. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_crypto_async.o +0 -0
  198. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_dyn_invoke.o +0 -0
  199. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_error.o +0 -0
  200. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
  201. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
  202. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
  203. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_grapheme.o +0 -0
  204. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_http.o +0 -0
  205. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_http2.o +0 -0
  206. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
  207. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
  208. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
  209. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
  210. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_net.o +0 -0
  211. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_node_builtin.o +0 -0
  212. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_object.o +0 -0
  213. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_qs.o +0 -0
  214. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
  215. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_stream.o +0 -0
  216. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_string.o +0 -0
  217. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_symbol.o +0 -0
  218. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_url.o +0 -0
  219. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_web.o +0 -0
  220. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
  221. package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
  222. package/dist/lib/runtime-darwin-arm64/package.json +1 -1
  223. package/dist/lib/runtime-darwin-arm64/runtime-pack.json +549 -545
  224. package/dist/lib/runtime-sources/package.json +1 -1
  225. package/dist/lib/runtime-sources/src/scr_abort.c +5 -0
  226. package/dist/lib/runtime-sources/src/scr_array.c +16 -0
  227. package/dist/lib/runtime-sources/src/scr_assert.c +1 -0
  228. package/dist/lib/runtime-sources/src/scr_async.c +38 -5
  229. package/dist/lib/runtime-sources/src/scr_async_dyn.c +208 -40
  230. package/dist/lib/runtime-sources/src/scr_bigint.c +8 -0
  231. package/dist/lib/runtime-sources/src/scr_bytes.c +431 -41
  232. package/dist/lib/runtime-sources/src/scr_bytes_io.c +628 -12
  233. package/dist/lib/runtime-sources/src/scr_child.c +544 -17
  234. package/dist/lib/runtime-sources/src/scr_console.c +1 -1
  235. package/dist/lib/runtime-sources/src/scr_crypto_async.c +22 -2
  236. package/dist/lib/runtime-sources/src/scr_dyn_invoke.c +344 -73
  237. package/dist/lib/runtime-sources/src/scr_error.c +52 -5
  238. package/dist/lib/runtime-sources/src/scr_exception.c +21 -5
  239. package/dist/lib/runtime-sources/src/scr_fetch.c +311 -3
  240. package/dist/lib/runtime-sources/src/scr_file_handle.c +31 -0
  241. package/dist/lib/runtime-sources/src/scr_http.c +3 -0
  242. package/dist/lib/runtime-sources/src/scr_island.c +1226 -405
  243. package/dist/lib/runtime-sources/src/scr_island_manifest.h +11 -9
  244. package/dist/lib/runtime-sources/src/scr_json.c +1594 -139
  245. package/dist/lib/runtime-sources/src/scr_json.test.ts +1 -0
  246. package/dist/lib/runtime-sources/src/scr_lib.c +816 -34
  247. package/dist/lib/runtime-sources/src/scr_map.c +47 -0
  248. package/dist/lib/runtime-sources/src/scr_node_builtin.c +10 -0
  249. package/dist/lib/runtime-sources/src/scr_object.c +11 -0
  250. package/dist/lib/runtime-sources/src/scr_qs.c +10 -0
  251. package/dist/lib/runtime-sources/src/scr_regex.c +148 -72
  252. package/dist/lib/runtime-sources/src/scr_runtime.h +257 -41
  253. package/dist/lib/runtime-sources/src/scr_stream.c +197 -0
  254. package/dist/lib/runtime-sources/src/scr_string.c +16 -1
  255. package/dist/lib/runtime-sources/src/scr_symbol.c +5 -0
  256. package/dist/lib/runtime-sources/src/scr_text_decoder_labels.h +225 -0
  257. package/dist/lib/runtime-sources/src/scr_url.c +206 -10
  258. package/dist/lib/runtime-sources/src/scr_web.c +129 -26
  259. package/dist/lib/runtime-sources/vendor/v8-number-radix/LICENSE +61 -0
  260. package/package.json +1 -1
@@ -763,6 +763,33 @@ ScrStr *scr_url_protocol(ScrUrl *u) {
763
763
  return ub_take(&b);
764
764
  }
765
765
 
766
+ /* Input conversion is the caller's responsibility. Only parser errors are
767
+ * suppressed: user toString errors must still escape the public factories. */
768
+ static ScrUrl *url_try_parse(ScrStr *input, ScrStr *base) {
769
+ ScrUrl *u = base ? scr_url_new_base(input, base) : scr_url_new(input);
770
+ if (!u) scr_exc_clear();
771
+ return u;
772
+ }
773
+
774
+ bool scr_url_can_parse_base(ScrStr *input, ScrStr *base) {
775
+ ScrUrl *u = url_try_parse(input, base);
776
+ bool valid = u != NULL;
777
+ scr_url_release(u);
778
+ return valid;
779
+ }
780
+
781
+ bool scr_url_can_parse(ScrStr *input) { return scr_url_can_parse_base(input, NULL); }
782
+
783
+ ScrDyn *scr_url_parse_base(ScrStr *input, ScrStr *base) {
784
+ ScrUrl *u = url_try_parse(input, base);
785
+ if (!u) return scr_dyn_new_null();
786
+ ScrDyn *value = scr_dyn_native_url(u);
787
+ scr_url_release(u);
788
+ return value;
789
+ }
790
+
791
+ ScrDyn *scr_url_parse(ScrStr *input) { return scr_url_parse_base(input, NULL); }
792
+
766
793
  ScrStr *scr_url_pathname(ScrUrl *u) { return scr_str_retain(u->path); }
767
794
 
768
795
  /* WHATWG host getter: host[:port] — the port only when non-default (the
@@ -872,7 +899,7 @@ static int hex_val(char c) {
872
899
  * letter otherwise. The public wrappers below select by TARGET. */
873
900
  static ScrStr *scr_url_to_path_impl(ScrUrl *u, bool win32) {
874
901
  if (!(u->scheme->len == 4 && memcmp(u->scheme->data, "file", 4) == 0)) {
875
- scr_throw_error_msg(SCR_ERR_TYPE, "The URL must be of scheme file", 30);
902
+ scr_throw_error_msg_code(SCR_ERR_TYPE, "The URL must be of scheme file", 30, "ERR_INVALID_URL_SCHEME");
876
903
  return NULL;
877
904
  }
878
905
  const char *p = u->path->data;
@@ -884,8 +911,8 @@ static ScrStr *scr_url_to_path_impl(ScrUrl *u, bool win32) {
884
911
  char c1 = p[n + 1];
885
912
  int third = (n + 2 < len ? (unsigned char)p[n + 2] : 0) | 0x20;
886
913
  if ((c1 == '2' && third == 'f') || (c1 == '5' && third == 'c')) {
887
- scr_throw_error_msg(SCR_ERR_TYPE,
888
- "File URL path must not include encoded \\ or / characters", 56);
914
+ scr_throw_error_msg_code(SCR_ERR_TYPE,
915
+ "File URL path must not include encoded \\ or / characters", 56, "ERR_INVALID_FILE_URL_PATH");
889
916
  return NULL;
890
917
  }
891
918
  }
@@ -916,7 +943,7 @@ static ScrStr *scr_url_to_path_impl(ScrUrl *u, bool win32) {
916
943
  char drive_sep = plen > 2 ? pp[2] : 0;
917
944
  if (letter < 'a' || letter > 'z' || drive_sep != ':') {
918
945
  free(out.data);
919
- scr_throw_error_msg(SCR_ERR_TYPE, "File URL path must be absolute", 30);
946
+ scr_throw_error_msg_code(SCR_ERR_TYPE, "File URL path must be absolute", 30, "ERR_INVALID_FILE_URL_PATH");
920
947
  return NULL;
921
948
  }
922
949
  /* pathname.slice(1): the leading backslash drops. */
@@ -938,7 +965,7 @@ static ScrStr *scr_url_to_path_impl(ScrUrl *u, bool win32) {
938
965
  #endif
939
966
  char msg[96];
940
967
  int mlen = snprintf(msg, sizeof msg, "File URL host must be \"localhost\" or empty on %s", plat);
941
- scr_throw_error_msg(SCR_ERR_TYPE, msg, (size_t)mlen);
968
+ scr_throw_error_msg_code(SCR_ERR_TYPE, msg, (size_t)mlen, "ERR_INVALID_FILE_URL_HOST");
942
969
  return NULL;
943
970
  }
944
971
  for (size_t i = 0; i < len; i++) {
@@ -948,8 +975,8 @@ static ScrStr *scr_url_to_path_impl(ScrUrl *u, bool win32) {
948
975
  if (hi >= 0 && lo >= 0) {
949
976
  unsigned char decoded = (unsigned char)((hi << 4) | lo);
950
977
  if (decoded == '/') {
951
- scr_throw_error_msg(SCR_ERR_TYPE,
952
- "File URL path must not include encoded / characters", 51);
978
+ scr_throw_error_msg_code(SCR_ERR_TYPE,
979
+ "File URL path must not include encoded / characters", 51, "ERR_INVALID_FILE_URL_PATH");
953
980
  return NULL;
954
981
  }
955
982
  i += 2;
@@ -1167,9 +1194,10 @@ ScrStr *scr_url_hash(ScrUrl *u) {
1167
1194
  /* Checked native URL values preserve their handle across unknown storage. */
1168
1195
  static ScrDyn *scr_native_url_get(void *ptr, const char *key, size_t len) {
1169
1196
  if (len == 12 && !memcmp(key, "searchParams", len)) {
1170
- static const char message[] = "Checked URL.searchParams has no native lowering";
1171
- scr_throw_error_msg_code(SCR_ERR_ERROR, message, sizeof message - 1, "SC2020");
1172
- return NULL;
1197
+ ScrSearchParams *params = scr_url_search_params(ptr);
1198
+ ScrDyn *result = scr_dyn_native_search_params(params);
1199
+ scr_sp_release(params);
1200
+ return result;
1173
1201
  }
1174
1202
  ScrStr *text = NULL;
1175
1203
  #define URL_GET(name) if (len == sizeof(#name) - 1 && memcmp(key, #name, len) == 0) text = scr_url_##name(ptr)
@@ -1223,6 +1251,174 @@ ScrUrl *scr_dyn_native_url_check(const ScrDyn *value, const ScrDynPath *path) {
1223
1251
  return scr_url_retain(value->v.handle.ptr);
1224
1252
  }
1225
1253
 
1254
+ static ScrDyn *scr_native_sp_get(void *ptr, const char *key, size_t len) {
1255
+ if (len == 4 && !memcmp(key, "size", len)) return scr_dyn_new_num(scr_sp_size(ptr));
1256
+ return scr_dyn_retain(scr_dyn_undefined());
1257
+ }
1258
+
1259
+ static ScrDyn *scr_native_sp_step(void *ptr, double *index, unsigned selection) {
1260
+ bool done = *index >= scr_sp_size(ptr);
1261
+ ScrDyn *value = scr_dyn_retain(scr_dyn_undefined());
1262
+ if (!done) {
1263
+ scr_dyn_release(value);
1264
+ ScrStr *key = scr_sp_key_at(ptr, *index), *text = scr_sp_val_at(ptr, *index);
1265
+ (*index)++;
1266
+ if (selection == 2) {
1267
+ value = scr_dyn_new_arr();
1268
+ scr_dyn_arr_push(value, scr_dyn_new_str(key));
1269
+ scr_dyn_arr_push(value, scr_dyn_new_str(text));
1270
+ } else value = scr_dyn_new_str(selection == 1 ? key : text);
1271
+ scr_str_release(key); scr_str_release(text);
1272
+ }
1273
+ ScrDyn *result = scr_dyn_new_obj();
1274
+ scr_dyn_obj_set(result, "done", 4, scr_dyn_new_bool(done));
1275
+ scr_dyn_obj_set(result, "value", 5, value);
1276
+ return result;
1277
+ }
1278
+
1279
+ static ScrDyn *scr_native_sp_invoke(void *ptr, ScrDyn *self, const char *method,
1280
+ ScrDyn *const *args, size_t argc, const char *what) {
1281
+ if (!strcmp(method, "entries") || !strcmp(method, "keys") || !strcmp(method, "values"))
1282
+ return scr_dyn_native_handle_iterator(self, !strcmp(method, "entries") ? 2 : !strcmp(method, "keys") ? 1 : 0);
1283
+ if (!strcmp(method, "toString")) {
1284
+ ScrStr *text = scr_sp_to_string(ptr);
1285
+ ScrDyn *result = scr_dyn_new_str(text);
1286
+ scr_str_release(text);
1287
+ return result;
1288
+ }
1289
+ if (!strcmp(method, "sort")) { scr_sp_sort(ptr); return scr_dyn_retain(scr_dyn_undefined()); }
1290
+ if (!strcmp(method, "forEach")) {
1291
+ if (!argc) { scr_dyn_arg_type_fail("callback", "of type function", scr_dyn_undefined()); return NULL; }
1292
+ for (double i = 0; i < scr_sp_size(ptr); i++) {
1293
+ ScrStr *key = scr_sp_key_at(ptr, i), *value = scr_sp_val_at(ptr, i);
1294
+ ScrDyn *argv[] = {scr_dyn_new_str(value), scr_dyn_new_str(key), self};
1295
+ scr_str_release(key); scr_str_release(value);
1296
+ scr_dyn_this_push_dyn(argc > 1 ? args[1] : NULL);
1297
+ ScrDyn *called = scr_dyn_call(args[0], argv, 3, "callback");
1298
+ scr_dyn_this_pop();
1299
+ scr_dyn_release(called); scr_dyn_release(argv[0]); scr_dyn_release(argv[1]);
1300
+ if (scr_exc_pending()) return NULL;
1301
+ }
1302
+ return scr_dyn_retain(scr_dyn_undefined());
1303
+ }
1304
+ bool two = !strcmp(method, "append") || !strcmp(method, "set");
1305
+ bool one = !strcmp(method, "get") || !strcmp(method, "getAll") || !strcmp(method, "has") || !strcmp(method, "delete");
1306
+ if (!one && !two) {
1307
+ scr_dyn_arg_type_fail(what, "of type function", scr_dyn_undefined());
1308
+ return NULL;
1309
+ }
1310
+ if (argc < (two ? 2 : 1)) {
1311
+ static const char message[] = "Not enough arguments";
1312
+ scr_throw_error_msg_code(SCR_ERR_TYPE, message, sizeof message - 1, "ERR_MISSING_ARGS");
1313
+ return NULL;
1314
+ }
1315
+ ScrStr *key = scr_dyn_string_coerce_js(args[0]);
1316
+ if (scr_exc_pending()) return NULL;
1317
+ ScrStr *value = NULL;
1318
+ if (two || argc > 1 && args[1]->kind != SCR_DYN_UNDEF) value = scr_dyn_string_coerce_js(args[1]);
1319
+ if (scr_exc_pending()) { scr_str_release(key); return NULL; }
1320
+ ScrDyn *result = NULL;
1321
+ if (!strcmp(method, "get")) {
1322
+ ScrStr *found = scr_sp_get(ptr, key);
1323
+ result = found ? scr_dyn_new_str(found) : scr_dyn_new_null();
1324
+ scr_str_release(found);
1325
+ } else if (!strcmp(method, "getAll")) {
1326
+ ScrArr *found = scr_sp_get_all(ptr, key);
1327
+ result = scr_dyn_new_arr();
1328
+ for (size_t i = 0; i < found->len; i++) {
1329
+ ScrStr *text = scr_arr_get_ref(found, i);
1330
+ scr_dyn_arr_push(result, scr_dyn_new_str(text));
1331
+ scr_str_release(text);
1332
+ }
1333
+ scr_arr_release(found);
1334
+ } else if (!strcmp(method, "has")) result = scr_dyn_new_bool(value ? scr_sp_has_value(ptr, key, value) : scr_sp_has(ptr, key));
1335
+ else {
1336
+ if (!strcmp(method, "append")) scr_sp_append(ptr, key, value);
1337
+ else if (!strcmp(method, "set")) scr_sp_set(ptr, key, value);
1338
+ else if (value) scr_sp_delete_value(ptr, key, value);
1339
+ else scr_sp_delete(ptr, key);
1340
+ result = scr_dyn_retain(scr_dyn_undefined());
1341
+ }
1342
+ scr_str_release(key); scr_str_release(value);
1343
+ return result;
1344
+ }
1345
+
1346
+ ScrDyn *scr_dyn_native_search_params(ScrSearchParams *value) {
1347
+ static const ScrDynHandleOps ops = {
1348
+ "URLSearchParams", &scr_sp_retain_v, &scr_sp_release_v, &scr_native_sp_invoke,
1349
+ &scr_native_sp_get, NULL, NULL, NULL, &scr_native_sp_step,
1350
+ };
1351
+ scr_dyn_handle_install(SCR_DYNH_SEARCH_PARAMS, &ops);
1352
+ return scr_dyn_new_handle(value, SCR_DYNH_SEARCH_PARAMS);
1353
+ }
1354
+
1355
+ bool scr_dyn_native_search_params_is(const ScrDyn *value) {
1356
+ return value && value->kind == SCR_DYN_HANDLE && value->v.handle.tag == SCR_DYNH_SEARCH_PARAMS;
1357
+ }
1358
+
1359
+ ScrSearchParams *scr_dyn_native_search_params_check(const ScrDyn *value, const ScrDynPath *path) {
1360
+ if (!scr_dyn_native_search_params_is(value)) { scr_dyn_check_fail(path, "URLSearchParams", value); return NULL; }
1361
+ return scr_sp_retain(value->v.handle.ptr);
1362
+ }
1363
+
1364
+ ScrSearchParams *scr_sp_new_checked(const ScrDyn *value) {
1365
+ if (!value || value->kind == SCR_DYN_UNDEF || value->kind == SCR_DYN_NULL) return scr_sp_new();
1366
+ if (scr_dyn_native_search_params_is(value)) return scr_sp_copy(value->v.handle.ptr);
1367
+ if (value->kind == SCR_DYN_OBJ || value->kind == SCR_DYN_ARR || value->kind == SCR_DYN_TYPED_REF) {
1368
+ ScrDyn *iterator = scr_dyn_iterator_optional(value);
1369
+ if (scr_exc_pending()) return NULL;
1370
+ ScrSearchParams *result = scr_sp_new();
1371
+ if (iterator) {
1372
+ for (;;) {
1373
+ ScrStr *next_key = scr_str_new("next", 4);
1374
+ ScrDyn *next = iterator->kind == SCR_DYN_HANDLE ? scr_dyn_handle_key_get(iterator, next_key) : scr_dyn_obj_read(iterator, "next", 4);
1375
+ scr_str_release(next_key);
1376
+ scr_dyn_this_push_dyn(iterator);
1377
+ ScrDyn *step = scr_exc_pending() ? NULL : scr_dyn_call(next, NULL, 0, "iterator.next");
1378
+ scr_dyn_this_pop();
1379
+ scr_dyn_release(next);
1380
+ if (scr_exc_pending()) break;
1381
+ ScrDyn *done = scr_dyn_obj_read(step, "done", 4);
1382
+ bool end = scr_dyn_truthy(done);
1383
+ scr_dyn_release(done);
1384
+ if (end) { scr_dyn_release(step); scr_dyn_release(iterator); return result; }
1385
+ ScrDyn *row = scr_dyn_obj_read(step, "value", 5);
1386
+ ScrDyn *pair = scr_dyn_iter_pack(row, NULL);
1387
+ scr_dyn_release(row); scr_dyn_release(step);
1388
+ if (scr_exc_pending()) { scr_dyn_release(pair); break; }
1389
+ if (!pair || pair->kind != SCR_DYN_ARR || pair->v.arr.len != 2) {
1390
+ static const char message[] = "Each query pair must be an iterable [name, value] tuple";
1391
+ scr_throw_error_msg_code(SCR_ERR_TYPE, message, sizeof message - 1, "ERR_INVALID_TUPLE");
1392
+ scr_dyn_release(pair); break;
1393
+ }
1394
+ ScrStr *key = scr_dyn_string_coerce_js(pair->v.arr.items[0]);
1395
+ ScrStr *text = scr_exc_pending() ? NULL : scr_dyn_string_coerce_js(pair->v.arr.items[1]);
1396
+ if (!scr_exc_pending()) scr_sp_append(result, key, text);
1397
+ scr_str_release(key); scr_str_release(text); scr_dyn_release(pair);
1398
+ if (scr_exc_pending()) break;
1399
+ }
1400
+ scr_dyn_release(iterator); scr_sp_release(result); return NULL;
1401
+ }
1402
+ ScrDyn *keys = scr_dyn_obj_keys(value);
1403
+ if (scr_exc_pending()) { scr_sp_release(result); return NULL; }
1404
+ for (size_t i = 0; i < keys->v.arr.len; i++) {
1405
+ ScrStr *key = keys->v.arr.items[i]->v.str;
1406
+ ScrDyn *entry = scr_dyn_obj_read(value, key->data, key->len);
1407
+ ScrStr *text = scr_exc_pending() ? NULL : scr_dyn_string_coerce_js(entry);
1408
+ scr_dyn_release(entry);
1409
+ if (!scr_exc_pending()) scr_sp_append(result, key, text);
1410
+ scr_str_release(text);
1411
+ if (scr_exc_pending()) { scr_dyn_release(keys); scr_sp_release(result); return NULL; }
1412
+ }
1413
+ scr_dyn_release(keys); return result;
1414
+ }
1415
+ ScrStr *text = scr_dyn_string_coerce_js(value);
1416
+ if (scr_exc_pending()) return NULL;
1417
+ ScrSearchParams *result = scr_sp_parse(text);
1418
+ scr_str_release(text);
1419
+ return result;
1420
+ }
1421
+
1226
1422
  ScrStr *scr_url_checked_to_path(const ScrDyn *value) {
1227
1423
  if (scr_dyn_native_url_is(value)) return scr_url_to_path(value->v.handle.ptr);
1228
1424
  if (value->kind == SCR_DYN_STR) return scr_url_str_to_path(value->v.str);
@@ -62,43 +62,77 @@ static const char web_prelude[] =
62
62
  " * (host.setTimer/host.clearTimer) — REF'd like Node's (an armed\n"
63
63
  " * timer keeps the process alive), FIFO-ordered against static\n"
64
64
  " * timers on one heap, Node's <1ms clamp. Returns a Timeout-shaped\n"
65
- " * object (ref/unref/refresh/close, numeric via toPrimitive) that\n"
66
- " * clearTimeout/clearInterval accept alongside plain ids; unref is\n"
67
- " * accepted but not honored (the entry stays ref'd — a documented\n"
68
- " * approximation). */\n"
65
+ " * object with real ref/unref/refresh/close operations. Immediates\n"
66
+ " * use the native check queue, independently of timer ids. */\n"
67
+ " const timers = new Map();\n"
69
68
  " class Timeout {\n"
70
- " constructor(fn, delay, repeat) {\n"
69
+ " constructor(fn, delay, args, repeat) {\n"
71
70
  " this._fn = fn;\n"
72
71
  " this._delay = delay;\n"
72
+ " this._args = args;\n"
73
73
  " this._repeat = repeat;\n"
74
- " this._id = host.setTimer(fn, delay, repeat);\n"
74
+ " this._reffed = true;\n"
75
+ " this._closed = false;\n"
76
+ " this._callback = () => {\n"
77
+ " if (!this._repeat) { this._destroyed = true; timers.delete(this._id); }\n"
78
+ " this._fn.apply(this, this._args);\n"
79
+ " };\n"
80
+ " this._arm();\n"
75
81
  " }\n"
76
- " ref() { return this; }\n"
77
- " unref() { return this; }\n"
78
- " hasRef() { return true; }\n"
82
+ " _arm() {\n"
83
+ " this._destroyed = false;\n"
84
+ " this._id = host.setTimer(this._callback, this._delay, this._repeat, false);\n"
85
+ " timers.set(this._id, this);\n"
86
+ " if (!this._reffed) host.refTimer(this._id, false, false);\n"
87
+ " }\n"
88
+ " ref() { this._reffed = true; host.refTimer(this._id, true, false); return this; }\n"
89
+ " unref() { this._reffed = false; host.refTimer(this._id, false, false); return this; }\n"
90
+ " hasRef() { return this._reffed; }\n"
79
91
  " refresh() {\n"
80
- " host.clearTimer(this._id);\n"
81
- " this._id = host.setTimer(this._fn, this._delay, this._repeat);\n"
92
+ " if (this._closed) return this;\n"
93
+ " if (this._destroyed) this._arm();\n"
94
+ " else host.refreshTimer(this._id);\n"
82
95
  " return this;\n"
83
96
  " }\n"
84
- " close() { host.clearTimer(this._id); return this; }\n"
97
+ " close() { this._closed = true; this._destroyed = true; timers.delete(this._id); host.clearTimer(this._id, false); return this; }\n"
98
+ " [Symbol.dispose]() { this.close(); }\n"
85
99
  " [Symbol.toPrimitive]() { return this._id; }\n"
86
100
  " }\n"
87
101
  " const mkTimer = (fn, ms, args, repeat) => {\n"
88
102
  " if (typeof fn !== 'function') {\n"
89
103
  " throw new TypeError('The \"callback\" argument must be of type function. Received type ' + typeof fn);\n"
90
104
  " }\n"
91
- " const cb = args.length === 0 ? fn : () => fn(...args);\n"
92
- " return new Timeout(cb, Number(ms), repeat);\n"
105
+ " return new Timeout(fn, Number(ms), args, repeat);\n"
93
106
  " };\n"
94
107
  " g.setTimeout = (fn, ms, ...args) => mkTimer(fn, ms, args, false);\n"
95
108
  " g.setInterval = (fn, ms, ...args) => mkTimer(fn, ms, args, true);\n"
96
109
  " g.clearTimeout = (t) => {\n"
97
110
  " if (t === undefined || t === null) return;\n"
98
111
  " const id = typeof t === 'number' ? t : Number(t);\n"
99
- " if (Number.isFinite(id)) host.clearTimer(id);\n"
112
+ " if (Number.isFinite(id)) {\n"
113
+ " const timer = timers.get(id);\n"
114
+ " if (timer) timer.close(); else host.clearTimer(id, false);\n"
115
+ " }\n"
100
116
  " };\n"
101
117
  " g.clearInterval = g.clearTimeout;\n"
118
+ " class Immediate {\n"
119
+ " constructor(fn, args) {\n"
120
+ " this._reffed = true; this._destroyed = false;\n"
121
+ " this._id = host.setTimer(() => {\n"
122
+ " this._destroyed = true; this._reffed = false; fn.apply(this, args);\n"
123
+ " }, 0, false, true);\n"
124
+ " }\n"
125
+ " ref() { if (!this._destroyed) { this._reffed = true; host.refTimer(this._id, true, true); } return this; }\n"
126
+ " unref() { if (!this._destroyed) { this._reffed = false; host.refTimer(this._id, false, true); } return this; }\n"
127
+ " hasRef() { return this._reffed; }\n"
128
+ " _close() { this._destroyed = true; this._reffed = false; host.clearTimer(this._id, true); }\n"
129
+ " [Symbol.dispose]() { this._close(); }\n"
130
+ " }\n"
131
+ " g.setImmediate = (fn, ...args) => {\n"
132
+ " if (typeof fn !== 'function') throw new TypeError('The \"callback\" argument must be of type function. Received type ' + typeof fn);\n"
133
+ " return new Immediate(fn, args);\n"
134
+ " };\n"
135
+ " g.clearImmediate = (immediate) => { if (immediate instanceof Immediate) immediate._close(); };\n"
102
136
  "\n"
103
137
  " class ReadableStream {\n"
104
138
  " constructor(source, _strategy) {\n"
@@ -503,8 +537,41 @@ static const char web_prelude[] =
503
537
  " g.TransformStream = TransformStream;\n"
504
538
  "\n"
505
539
  "\n"
540
+ " const textEncoders = new WeakSet();\n"
506
541
  " class TextEncoder {\n"
542
+ " constructor() { textEncoders.add(this); }\n"
507
543
  " get encoding() { return 'utf-8'; }\n"
544
+ " encodeInto(src, dest) {\n"
545
+ " const fail = (name, expected, value) => {\n"
546
+ " let received;\n"
547
+ " if (value === null || value === undefined) received = String(value);\n"
548
+ " else if (typeof value === 'object' || typeof value === 'function') received = 'an instance of ' + (value.constructor && value.constructor.name || 'Object');\n"
549
+ " else if (typeof value === 'string') received = \"type string ('\" + value + \"')\";\n"
550
+ " else received = 'type ' + typeof value + ' (' + String(value) + (typeof value === 'bigint' ? 'n' : '') + ')';\n"
551
+ " const error = new TypeError('The \"' + name + '\" argument must be ' + expected + '. Received ' + received);\n"
552
+ " error.code = 'ERR_INVALID_ARG_TYPE'; throw error;\n"
553
+ " };\n"
554
+ " if (!textEncoders.has(this)) { const error = new TypeError('Value of \"this\" must be of type TextEncoder'); error.code = 'ERR_INVALID_THIS'; throw error; }\n"
555
+ " if (typeof src !== 'string') fail('src', 'of type string', src);\n"
556
+ " if (!(dest instanceof Uint8Array)) fail('dest', 'an instance of Uint8Array', dest);\n"
557
+ " let read = 0, written = 0;\n"
558
+ " while (read < src.length) {\n"
559
+ " let cp = src.charCodeAt(read), units = 1;\n"
560
+ " if (cp >= 0xd800 && cp <= 0xdbff) {\n"
561
+ " const low = src.charCodeAt(read + 1);\n"
562
+ " if (low >= 0xdc00 && low <= 0xdfff) { cp = 0x10000 + ((cp - 0xd800) << 10) + low - 0xdc00; units = 2; }\n"
563
+ " else cp = 0xfffd;\n"
564
+ " } else if (cp >= 0xdc00 && cp <= 0xdfff) cp = 0xfffd;\n"
565
+ " const size = cp < 0x80 ? 1 : cp < 0x800 ? 2 : cp < 0x10000 ? 3 : 4;\n"
566
+ " if (written + size > dest.length) break;\n"
567
+ " if (size === 1) dest[written++] = cp;\n"
568
+ " else if (size === 2) { dest[written++] = 0xc0 | (cp >> 6); dest[written++] = 0x80 | (cp & 63); }\n"
569
+ " else if (size === 3) { dest[written++] = 0xe0 | (cp >> 12); dest[written++] = 0x80 | ((cp >> 6) & 63); dest[written++] = 0x80 | (cp & 63); }\n"
570
+ " else { dest[written++] = 0xf0 | (cp >> 18); dest[written++] = 0x80 | ((cp >> 12) & 63); dest[written++] = 0x80 | ((cp >> 6) & 63); dest[written++] = 0x80 | (cp & 63); }\n"
571
+ " read += units;\n"
572
+ " }\n"
573
+ " return { read, written };\n"
574
+ " }\n"
508
575
  " encode(input) {\n"
509
576
  " const s = input === undefined ? '' : String(input);\n"
510
577
  " const bytes = [];\n"
@@ -891,13 +958,14 @@ static const char web_prelude[] =
891
958
  " const once = !!(options !== null && typeof options === 'object' && options.once);\n"
892
959
  " const list = this._et[t] || (this._et[t] = []);\n"
893
960
  " for (const e of list) { if (e.listener === listener) return; }\n"
894
- " list.push({ listener, once });\n"
961
+ " const resistant = !!(options && options[Symbol.for('scriptc.events.resistStopPropagation')]);\n"
962
+ " list.push({ listener, once, resistant });\n"
895
963
  " }\n"
896
964
  " removeEventListener(type, listener) {\n"
897
965
  " const list = this._et[String(type)];\n"
898
966
  " if (!list) return;\n"
899
967
  " const i = list.findIndex((e) => e.listener === listener);\n"
900
- " if (i >= 0) list.splice(i, 1);\n"
968
+ " if (i >= 0) list.splice(i, 1)[0].removed = true;\n"
901
969
  " }\n"
902
970
  " dispatchEvent(event) {\n"
903
971
  " if (!(event instanceof Event)) throw new TypeError('The \"event\" argument must be an instance of Event.');\n"
@@ -907,7 +975,8 @@ static const char web_prelude[] =
907
975
  " const list = this._et[event.type];\n"
908
976
  " if (list) {\n"
909
977
  " for (const e of [...list]) {\n"
910
- " if (event._stopImmediate) break;\n"
978
+ " if (e.removed) continue;\n"
979
+ " if (event._stopImmediate && !e.resistant) continue;\n"
911
980
  " if (e.once) this.removeEventListener(event.type, e.listener);\n"
912
981
  " if (typeof e.listener === 'function') e.listener.call(this, event);\n"
913
982
  " else if (e.listener !== null && typeof e.listener.handleEvent === 'function') e.listener.handleEvent(event);\n"
@@ -1054,13 +1123,16 @@ static const char web_prelude[] =
1054
1123
  " if (s._aborted) return;\n"
1055
1124
  " s._aborted = true;\n"
1056
1125
  " s._reason = reason === undefined ? mkAbortError() : reason;\n"
1057
- " const ev = { type: 'abort', target: s, currentTarget: s };\n"
1126
+ " const ev = new Event('abort');\n"
1127
+ " ev.target = s; ev.currentTarget = s; ev.eventPhase = Event.AT_TARGET; ev.isTrusted = true;\n"
1058
1128
  " let firstErr;\n"
1059
1129
  " let threw = false;\n"
1060
1130
  " if (s._onabort !== null) {\n"
1061
1131
  " try { s._onabort.call(s, ev); } catch (e) { firstErr = e; threw = true; }\n"
1062
1132
  " }\n"
1063
1133
  " for (const l of s._listeners.slice()) {\n"
1134
+ " if (l.removed) continue;\n"
1135
+ " if (ev._stopImmediate && !l.resistant) continue;\n"
1064
1136
  " if (l.once) s.removeEventListener('abort', l.fn);\n"
1065
1137
  " try { l.fn.call(s, ev); } catch (e) { if (!threw) { firstErr = e; threw = true; } }\n"
1066
1138
  " }\n"
@@ -1076,13 +1148,15 @@ static const char web_prelude[] =
1076
1148
  " throwIfAborted() { if (this._aborted) throw this._reason; }\n"
1077
1149
  " addEventListener(type, fn, options) {\n"
1078
1150
  " if (String(type) !== 'abort' || typeof fn !== 'function') return;\n"
1151
+ " if (this._listeners.some(l => l.fn === fn)) return;\n"
1079
1152
  " const once = options !== undefined && options !== null && !!options.once;\n"
1080
- " this._listeners.push({ fn, once });\n"
1153
+ " const resistant = !!(options && options[Symbol.for('scriptc.events.resistStopPropagation')]);\n"
1154
+ " this._listeners.push({ fn, once, resistant });\n"
1081
1155
  " }\n"
1082
1156
  " removeEventListener(type, fn) {\n"
1083
1157
  " if (String(type) !== 'abort') return;\n"
1084
1158
  " const i = this._listeners.findIndex((l) => l.fn === fn);\n"
1085
- " if (i >= 0) this._listeners.splice(i, 1);\n"
1159
+ " if (i >= 0) this._listeners.splice(i, 1)[0].removed = true;\n"
1086
1160
  " }\n"
1087
1161
  " static abort(reason) {\n"
1088
1162
  " const s = mkSignal();\n"
@@ -1633,7 +1707,6 @@ static void web_timer_fire_cb(ScrClosure *env) {
1633
1707
  static JSValue web_host_set_timer(JSContext *ctx, JSValueConst this_val,
1634
1708
  int argc, JSValueConst *argv) {
1635
1709
  (void)this_val;
1636
- (void)argc;
1637
1710
  double ms = 0;
1638
1711
  if (JS_ToFloat64(ctx, &ms, argv[1])) return JS_EXCEPTION;
1639
1712
  bool repeat = JS_ToBool(ctx, argv[2]) > 0;
@@ -1649,17 +1722,45 @@ static JSValue web_host_set_timer(JSContext *ctx, JSValueConst this_val,
1649
1722
  scr_box_set_ref(box, h); /* the box owns the +1 */
1650
1723
  ScrClosure *cb = scr_closure_new((void *)web_timer_fire_cb, 1);
1651
1724
  cb->caps[0] = box;
1652
- double id = repeat ? scr_set_interval(cb, ms) : scr_set_timeout_handle(cb, ms);
1725
+ bool immediate = argc > 3 && JS_ToBool(ctx, argv[3]) > 0;
1726
+ double id = immediate ? scr_set_immediate(cb)
1727
+ : repeat ? scr_set_interval(cb, ms) : scr_set_timeout_handle(cb, ms);
1653
1728
  return JS_NewFloat64(ctx, id);
1654
1729
  }
1655
1730
 
1656
1731
  static JSValue web_host_clear_timer(JSContext *ctx, JSValueConst this_val,
1657
1732
  int argc, JSValueConst *argv) {
1658
1733
  (void)this_val;
1734
+ double id = 0;
1735
+ if (JS_ToFloat64(ctx, &id, argv[0])) return JS_EXCEPTION;
1736
+ if (argc > 1 && JS_ToBool(ctx, argv[1]) > 0) scr_clear_immediate(id);
1737
+ else scr_clear_interval(id);
1738
+ return JS_UNDEFINED;
1739
+ }
1740
+
1741
+ static JSValue web_host_ref_timer(JSContext *ctx, JSValueConst this_val,
1742
+ int argc, JSValueConst *argv) {
1743
+ (void)this_val;
1744
+ (void)argc;
1745
+ double id = 0;
1746
+ if (JS_ToFloat64(ctx, &id, argv[0])) return JS_EXCEPTION;
1747
+ bool reffed = JS_ToBool(ctx, argv[1]) > 0;
1748
+ bool immediate = JS_ToBool(ctx, argv[2]) > 0;
1749
+ if (immediate) {
1750
+ if (reffed) scr_immediate_ref(id); else scr_immediate_unref(id);
1751
+ } else {
1752
+ if (reffed) scr_timer_ref(id); else scr_timer_unref(id);
1753
+ }
1754
+ return JS_UNDEFINED;
1755
+ }
1756
+
1757
+ static JSValue web_host_refresh_timer(JSContext *ctx, JSValueConst this_val,
1758
+ int argc, JSValueConst *argv) {
1759
+ (void)this_val;
1659
1760
  (void)argc;
1660
1761
  double id = 0;
1661
1762
  if (JS_ToFloat64(ctx, &id, argv[0])) return JS_EXCEPTION;
1662
- scr_clear_interval(id);
1763
+ scr_timer_refresh(id);
1663
1764
  return JS_UNDEFINED;
1664
1765
  }
1665
1766
 
@@ -1837,8 +1938,10 @@ void scr_island_web_boot(void *jsctx) {
1837
1938
  JS_SetPropertyStr(ctx, host, "write", JS_NewCFunction(ctx, web_host_write, "write", 2));
1838
1939
  JS_SetPropertyStr(ctx, host, "tzname", JS_NewCFunction(ctx, web_host_tzname, "tzname", 1));
1839
1940
  JS_SetPropertyStr(ctx, host, "timer", JS_NewCFunction(ctx, web_host_timer, "timer", 2));
1840
- JS_SetPropertyStr(ctx, host, "setTimer", JS_NewCFunction(ctx, web_host_set_timer, "setTimer", 3));
1841
- JS_SetPropertyStr(ctx, host, "clearTimer", JS_NewCFunction(ctx, web_host_clear_timer, "clearTimer", 1));
1941
+ JS_SetPropertyStr(ctx, host, "setTimer", JS_NewCFunction(ctx, web_host_set_timer, "setTimer", 4));
1942
+ JS_SetPropertyStr(ctx, host, "clearTimer", JS_NewCFunction(ctx, web_host_clear_timer, "clearTimer", 2));
1943
+ JS_SetPropertyStr(ctx, host, "refTimer", JS_NewCFunction(ctx, web_host_ref_timer, "refTimer", 3));
1944
+ JS_SetPropertyStr(ctx, host, "refreshTimer", JS_NewCFunction(ctx, web_host_refresh_timer, "refreshTimer", 1));
1842
1945
  JSValue r = JS_Call(ctx, fn, JS_UNDEFINED, 1, (JSValueConst *)&host);
1843
1946
  JS_FreeValue(ctx, host);
1844
1947
  JS_FreeValue(ctx, fn);
@@ -0,0 +1,61 @@
1
+ This license applies to all parts of V8 that are not externally
2
+ maintained libraries. The externally maintained libraries used by V8
3
+ are:
4
+
5
+ - PCRE test suite, located in
6
+ test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the
7
+ test suite from PCRE-7.3, which is copyrighted by the University
8
+ of Cambridge and Google, Inc. The copyright notice and license
9
+ are embedded in regexp-pcre.js.
10
+
11
+ - Layout tests, located in test/mjsunit/third_party/object-keys. These are
12
+ based on layout tests from webkit.org which are copyrighted by
13
+ Apple Computer, Inc. and released under a 3-clause BSD license.
14
+
15
+ - Strongtalk assembler, the basis of the files assembler-arm-inl.h,
16
+ assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
17
+ assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h,
18
+ assembler-x64.cc, assembler-x64.h, assembler.cc and assembler.h.
19
+ This code is copyrighted by Sun Microsystems Inc. and released
20
+ under a 3-clause BSD license.
21
+
22
+ - Valgrind client API header, located at third_party/valgrind/valgrind.h
23
+ This is released under the BSD license.
24
+
25
+ - The Wasm C/C++ API headers, located at third_party/wasm-api/wasm.{h,hh}
26
+ This is released under the Apache license. The API's upstream prototype
27
+ implementation also formed the basis of V8's implementation in
28
+ src/wasm/c-api.cc.
29
+
30
+ These libraries have their own licenses; we recommend you read them,
31
+ as their terms may differ from the terms below.
32
+
33
+ Further license information can be found in LICENSE files located in
34
+ sub-directories.
35
+
36
+ Copyright 2014, the V8 project authors. All rights reserved.
37
+ Redistribution and use in source and binary forms, with or without
38
+ modification, are permitted provided that the following conditions are
39
+ met:
40
+
41
+ * Redistributions of source code must retain the above copyright
42
+ notice, this list of conditions and the following disclaimer.
43
+ * Redistributions in binary form must reproduce the above
44
+ copyright notice, this list of conditions and the following
45
+ disclaimer in the documentation and/or other materials provided
46
+ with the distribution.
47
+ * Neither the name of Google Inc. nor the names of its
48
+ contributors may be used to endorse or promote products derived
49
+ from this software without specific prior written permission.
50
+
51
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scriptc/cli-darwin-arm64",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Native scriptc compiler for darwin-arm64",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scriptc.dev",