@scriptc/cli-darwin-x64 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE +202 -0
- package/dist/THIRD_PARTY_NOTICES +4 -0
- package/dist/bin/scriptc +0 -0
- package/dist/bin/scriptc.json +21 -0
- package/dist/lib/declarations/scriptc-node-fallback.d.ts +3847 -0
- package/dist/lib/declarations/scriptc-overrides.d.ts +92 -0
- package/dist/lib/declarations/scriptc.d.ts +98 -0
- package/dist/lib/llvm/LICENSE +1 -0
- package/dist/lib/llvm/SCRIPTC_LICENSE +1 -0
- package/dist/lib/llvm/THIRD_PARTY_NOTICES +1 -0
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +35 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_inspect_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_net_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_zlib_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_library.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_library.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_library.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_library.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/mbedtls.txt +553 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/quickjs-ng.txt +24 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/ryu.txt +23 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/scriptc-runtime.txt +202 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/unicode.txt +39 -0
- package/dist/lib/runtime-darwin-x64/artifacts/licenses/zlib.txt +22 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_inspect_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_net_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_zlib_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/vendor/libregexp/libscriptc-libregexp.a +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/vendor/mbedtls/libscriptc-mbedtls.a +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/vendor/quickjs/libscriptc-quickjs.a +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/vendor/zlib/libscriptc-zlib.a +0 -0
- package/dist/lib/runtime-darwin-x64/package.json +24 -0
- package/dist/lib/runtime-darwin-x64/runtime-pack.json +5758 -0
- package/dist/lib/runtime-sources/LICENSE +202 -0
- package/dist/lib/runtime-sources/package.json +22 -0
- package/dist/lib/runtime-sources/src/scr_array.c +1444 -0
- package/dist/lib/runtime-sources/src/scr_assert.c +1537 -0
- package/dist/lib/runtime-sources/src/scr_async.c +3920 -0
- package/dist/lib/runtime-sources/src/scr_async.test.c +134 -0
- package/dist/lib/runtime-sources/src/scr_async.test.ts +34 -0
- package/dist/lib/runtime-sources/src/scr_async_dyn.c +803 -0
- package/dist/lib/runtime-sources/src/scr_bigint.c +890 -0
- package/dist/lib/runtime-sources/src/scr_bigint_assert.c +22 -0
- package/dist/lib/runtime-sources/src/scr_bytes.c +2518 -0
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +755 -0
- package/dist/lib/runtime-sources/src/scr_child.c +5808 -0
- package/dist/lib/runtime-sources/src/scr_closure.c +213 -0
- package/dist/lib/runtime-sources/src/scr_console.c +259 -0
- package/dist/lib/runtime-sources/src/scr_console_native.c +95 -0
- package/dist/lib/runtime-sources/src/scr_copying.c +146 -0
- package/dist/lib/runtime-sources/src/scr_crypto_async.c +24 -0
- package/dist/lib/runtime-sources/src/scr_cycle.c +565 -0
- package/dist/lib/runtime-sources/src/scr_dc.c +814 -0
- package/dist/lib/runtime-sources/src/scr_dgram.c +1182 -0
- package/dist/lib/runtime-sources/src/scr_dyn_handle.c +96 -0
- package/dist/lib/runtime-sources/src/scr_dyn_invoke.c +1626 -0
- package/dist/lib/runtime-sources/src/scr_error.c +372 -0
- package/dist/lib/runtime-sources/src/scr_events.c +1222 -0
- package/dist/lib/runtime-sources/src/scr_events_emitter.c +842 -0
- package/dist/lib/runtime-sources/src/scr_exception.c +468 -0
- package/dist/lib/runtime-sources/src/scr_fetch.c +7215 -0
- package/dist/lib/runtime-sources/src/scr_fetch_curl.c +666 -0
- package/dist/lib/runtime-sources/src/scr_ffi.c +143 -0
- package/dist/lib/runtime-sources/src/scr_ffi_queue.c +379 -0
- package/dist/lib/runtime-sources/src/scr_file_handle.c +562 -0
- package/dist/lib/runtime-sources/src/scr_grapheme.c +203 -0
- package/dist/lib/runtime-sources/src/scr_grapheme_data.h +842 -0
- package/dist/lib/runtime-sources/src/scr_http.c +5808 -0
- package/dist/lib/runtime-sources/src/scr_http2.c +3243 -0
- package/dist/lib/runtime-sources/src/scr_inspect.c +923 -0
- package/dist/lib/runtime-sources/src/scr_inspect_island.c +51 -0
- package/dist/lib/runtime-sources/src/scr_island.c +9987 -0
- package/dist/lib/runtime-sources/src/scr_island_manifest.h +153 -0
- package/dist/lib/runtime-sources/src/scr_json.c +7928 -0
- package/dist/lib/runtime-sources/src/scr_json.test.c +182 -0
- package/dist/lib/runtime-sources/src/scr_json.test.ts +33 -0
- package/dist/lib/runtime-sources/src/scr_lib.c +6304 -0
- package/dist/lib/runtime-sources/src/scr_library.c +444 -0
- package/dist/lib/runtime-sources/src/scr_loop_epoll.c +241 -0
- package/dist/lib/runtime-sources/src/scr_loop_kqueue.c +121 -0
- package/dist/lib/runtime-sources/src/scr_loop_wsapoll.c +208 -0
- package/dist/lib/runtime-sources/src/scr_map.c +705 -0
- package/dist/lib/runtime-sources/src/scr_musl.c +438 -0
- package/dist/lib/runtime-sources/src/scr_net.c +3708 -0
- package/dist/lib/runtime-sources/src/scr_net_island.c +458 -0
- package/dist/lib/runtime-sources/src/scr_node_builtin.c +281 -0
- package/dist/lib/runtime-sources/src/scr_number.c +192 -0
- package/dist/lib/runtime-sources/src/scr_object.c +80 -0
- package/dist/lib/runtime-sources/src/scr_path.c +1281 -0
- package/dist/lib/runtime-sources/src/scr_platform.h +119 -0
- package/dist/lib/runtime-sources/src/scr_qs.c +496 -0
- package/dist/lib/runtime-sources/src/scr_readline.c +288 -0
- package/dist/lib/runtime-sources/src/scr_regex.c +1274 -0
- package/dist/lib/runtime-sources/src/scr_runtime.h +7207 -0
- package/dist/lib/runtime-sources/src/scr_stream.c +3149 -0
- package/dist/lib/runtime-sources/src/scr_string.c +1849 -0
- package/dist/lib/runtime-sources/src/scr_symbol.c +234 -0
- package/dist/lib/runtime-sources/src/scr_test.c +662 -0
- package/dist/lib/runtime-sources/src/scr_text_decoder_data.h +7389 -0
- package/dist/lib/runtime-sources/src/scr_tls.c +1806 -0
- package/dist/lib/runtime-sources/src/scr_tls_ca.c +433 -0
- package/dist/lib/runtime-sources/src/scr_union.c +105 -0
- package/dist/lib/runtime-sources/src/scr_url.c +1231 -0
- package/dist/lib/runtime-sources/src/scr_url_internal.h +29 -0
- package/dist/lib/runtime-sources/src/scr_url_params.c +526 -0
- package/dist/lib/runtime-sources/src/scr_util.c +984 -0
- package/dist/lib/runtime-sources/src/scr_watch.c +568 -0
- package/dist/lib/runtime-sources/src/scr_web.c +1854 -0
- package/dist/lib/runtime-sources/src/scr_win.c +231 -0
- package/dist/lib/runtime-sources/src/scr_win_stats.h +23 -0
- package/dist/lib/runtime-sources/src/scr_zlib.c +358 -0
- package/dist/lib/runtime-sources/src/scr_zlib_island.c +15 -0
- package/dist/lib/runtime-sources/vendor/README.md +60 -0
- package/dist/lib/runtime-sources/vendor/curl/COPYRIGHT +534 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/curl.h +3214 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/curlver.h +79 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/easy.h +125 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/header.h +74 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/mprintf.h +52 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/multi.h +460 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/options.h +70 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/stdcheaders.h +35 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/system.h +508 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/typecheck-gcc.h +716 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/urlapi.h +149 -0
- package/dist/lib/runtime-sources/vendor/curl/include/curl/websockets.h +84 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/LICENSE +553 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/CMakeLists.txt +22 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/aes.h +631 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/aria.h +343 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/asn1.h +642 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/asn1write.h +390 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/base64.h +82 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/bignum.h +1088 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/block_cipher.h +76 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/build_info.h +194 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/camellia.h +305 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ccm.h +526 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/chacha20.h +209 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/chachapoly.h +351 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/check_config.h +1149 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/cipher.h +1250 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/cmac.h +246 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/compat-2.x.h +46 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_legacy_crypto.h +578 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_legacy_from_psa.h +873 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_psa_from_legacy.h +359 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_psa_superset_legacy.h +145 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_ssl.h +91 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_adjust_x509.h +35 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/config_psa.h +61 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/constant_time.h +36 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ctr_drbg.h +596 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/debug.h +156 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/des.h +385 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/dhm.h +972 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ecdh.h +455 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ecdsa.h +674 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ecjpake.h +298 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ecp.h +1517 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/entropy.h +274 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/error.h +201 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/gcm.h +387 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/hkdf.h +124 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/hmac_drbg.h +434 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/lms.h +440 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/mbedtls_config.h +4446 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/md.h +526 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/md5.h +190 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/memory_buffer_alloc.h +142 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/net_sockets.h +299 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/nist_kw.h +166 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/oid.h +727 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/pem.h +160 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/pk.h +1303 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/pkcs12.h +186 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/pkcs5.h +198 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/pkcs7.h +252 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/platform.h +516 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/platform_time.h +79 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/platform_util.h +247 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/poly1305.h +168 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/private_access.h +20 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/psa_util.h +207 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ripemd160.h +136 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/rsa.h +1170 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/sha1.h +219 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/sha256.h +200 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/sha3.h +172 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/sha512.h +208 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ssl.h +5887 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ssl_cache.h +187 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ssl_ciphersuites.h +482 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ssl_cookie.h +106 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/ssl_ticket.h +199 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/threading.h +167 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/timing.h +94 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/version.h +78 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/x509.h +500 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/x509_crl.h +184 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/x509_crt.h +1208 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/mbedtls/x509_csr.h +382 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/build_info.h +20 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto.h +4998 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_adjust_auto_enabled.h +31 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_adjust_config_dependencies.h +51 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_adjust_config_key_pair_types.h +101 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_adjust_config_synonyms.h +49 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_builtin_composites.h +214 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_builtin_key_derivation.h +118 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_builtin_primitives.h +114 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_compat.h +230 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_config.h +145 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_driver_common.h +44 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_driver_contexts_composites.h +151 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_driver_contexts_key_derivation.h +52 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_driver_contexts_primitives.h +105 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_extra.h +2145 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_legacy.h +88 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_platform.h +102 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_se_driver.h +1383 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_sizes.h +1319 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_struct.h +527 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_types.h +508 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/include/psa/crypto_values.h +2782 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aes.c +2294 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aesce.c +624 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aesce.h +136 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aesni.c +846 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aesni.h +162 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/alignment.h +704 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/aria.c +969 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/asn1parse.c +468 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/asn1write.c +440 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/base64.c +322 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/base64_internal.h +45 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum.c +2583 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_core.c +1240 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_core.h +872 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_core_invasive.h +38 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_internal.h +122 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_mod.c +394 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_mod.h +452 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_mod_raw.c +276 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_mod_raw.h +416 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bignum_mod_raw_invasive.h +34 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/block_cipher.c +207 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/block_cipher_internal.h +99 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/bn_mul.h +1094 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/camellia.c +1058 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ccm.c +777 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/chacha20.c +563 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/chacha20_internal.h +23 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/chachapoly.c +487 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/check_crypto_config.h +136 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/cipher.c +1712 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/cipher_invasive.h +28 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/cipher_wrap.c +2482 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/cipher_wrap.h +178 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/cmac.c +1067 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/common.h +487 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/constant_time.c +247 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/constant_time_impl.h +541 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/constant_time_internal.h +579 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ctr.h +35 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ctr_drbg.c +1016 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/debug.c +475 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/debug_internal.h +185 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/des.c +1042 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/dhm.c +700 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecdh.c +696 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecdsa.c +858 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecjpake.c +1216 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecp.c +3674 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecp_curves.c +6125 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecp_curves_new.c +9 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecp_internal_alt.h +287 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ecp_invasive.h +305 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/entropy.c +680 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/entropy_poll.c +233 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/entropy_poll.h +64 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/error.c +878 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/gcm.c +1330 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/hkdf.c +161 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/hmac_drbg.c +633 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/lmots.c +789 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/lmots.h +288 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/lms.c +778 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/md.c +1108 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/md5.c +426 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/md_psa.h +26 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/md_wrap.h +46 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/memory_buffer_alloc.c +751 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_common.h +181 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_error.h +89 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_reader.c +538 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_reader.h +366 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_trace.c +112 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/mps_trace.h +154 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/net_sockets.c +694 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/nist_kw.c +729 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/oid.c +1166 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/padlock.c +157 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/padlock.h +111 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pem.c +554 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pk.c +1602 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pk_ecc.c +261 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pk_internal.h +241 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pk_wrap.c +1618 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pk_wrap.h +138 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkcs12.c +437 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkcs5.c +500 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkcs7.c +787 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkparse.c +1392 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkwrite.c +631 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/pkwrite.h +121 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/platform.c +402 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/platform_util.c +258 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/poly1305.c +492 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto.c +9532 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_aead.c +646 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_aead.h +499 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_cipher.c +747 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_cipher.h +316 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_client.c +22 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_core.h +983 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_core_common.h +52 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_driver_wrappers.h +2896 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_driver_wrappers_no_static.c +256 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_driver_wrappers_no_static.h +31 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_ecp.c +594 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_ecp.h +267 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_ffdh.c +361 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_ffdh.h +131 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_hash.c +470 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_hash.h +211 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_invasive.h +92 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_its.h +131 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_mac.c +505 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_mac.h +264 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_pake.c +571 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_pake.h +159 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_random.c +181 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_random.h +72 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_random_impl.h +200 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_rsa.c +714 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_rsa.h +321 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_se.c +373 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_se.h +192 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_slot_management.c +1137 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_slot_management.h +344 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_storage.c +481 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_crypto_storage.h +392 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_its_file.c +254 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_util.c +614 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/psa_util_internal.h +100 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ripemd160.c +490 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/rsa.c +3121 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/rsa_alt_helpers.c +455 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/rsa_alt_helpers.h +209 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/rsa_internal.h +188 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/sha1.c +480 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/sha256.c +983 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/sha3.c +721 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/sha512.c +1115 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_cache.c +410 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_ciphersuites.c +2050 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_ciphersuites_internal.h +154 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_client.c +1023 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_client.h +22 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_cookie.c +384 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_debug_helpers.h +85 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_debug_helpers_generated.c +251 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_misc.h +3198 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_msg.c +6619 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_ticket.c +556 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls.c +10234 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls12_client.c +3688 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls12_server.c +4311 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_client.c +3208 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_generic.c +1793 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_invasive.h +23 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_keys.c +1918 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_keys.h +668 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/ssl_tls13_server.c +3624 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/threading.c +193 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/threading_internal.h +28 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/timing.c +152 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/version.c +32 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/version_features.c +856 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509.c +1776 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509_create.c +570 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509_crl.c +708 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509_crt.c +3311 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509_csr.c +648 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509_internal.h +101 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509write.c +174 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509write_crt.c +688 -0
- package/dist/lib/runtime-sources/vendor/mbedtls/library/x509write_csr.c +336 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/CMakeLists.txt +566 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/LICENSE +24 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/README.md +24 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/api-test.c +1195 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/builtin-array-fromasync.h +119 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/builtin-iterator-zip-keyed.h +332 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/builtin-iterator-zip.h +337 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/cutils.h +1998 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/dtoa.c +1619 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/dtoa.h +87 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/function_source.c +81 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/hello.c +53 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/hello_module.c +106 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/repl.c +3036 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/standalone.c +323 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/gen/test_fib.c +81 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libregexp-opcode.h +73 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libregexp.c +3474 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libregexp.h +101 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libunicode-table.h +5173 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libunicode.c +2069 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/libunicode.h +172 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/list.h +107 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/lre-test.c +52 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/qjs.c +762 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/qjsc.c +673 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs-atom.h +280 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs-c-atomics.h +54 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs-libc.c +5037 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs-libc.h +87 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs-opcode.h +377 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs.c +64041 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/quickjs.h +1447 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/run-test262.c +2374 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/unicode_gen.c +3121 -0
- package/dist/lib/runtime-sources/vendor/quickjs-ng/unicode_gen_def.h +310 -0
- package/dist/lib/runtime-sources/vendor/ryu/LICENSE-Boost +23 -0
- package/dist/lib/runtime-sources/vendor/ryu/common.h +114 -0
- package/dist/lib/runtime-sources/vendor/ryu/d2s.c +509 -0
- package/dist/lib/runtime-sources/vendor/ryu/d2s_full_table.h +367 -0
- package/dist/lib/runtime-sources/vendor/ryu/d2s_intrinsics.h +357 -0
- package/dist/lib/runtime-sources/vendor/ryu/d2s_small_table.h +186 -0
- package/dist/lib/runtime-sources/vendor/ryu/digit_table.h +35 -0
- package/dist/lib/runtime-sources/vendor/ryu/ryu.h +46 -0
- package/dist/lib/runtime-sources/vendor/unicode/LICENSE +39 -0
- package/dist/lib/runtime-sources/vendor/zlib/LICENSE +22 -0
- package/dist/lib/runtime-sources/vendor/zlib/adler32.c +164 -0
- package/dist/lib/runtime-sources/vendor/zlib/compress.c +75 -0
- package/dist/lib/runtime-sources/vendor/zlib/crc32.c +1049 -0
- package/dist/lib/runtime-sources/vendor/zlib/crc32.h +9446 -0
- package/dist/lib/runtime-sources/vendor/zlib/deflate.c +2139 -0
- package/dist/lib/runtime-sources/vendor/zlib/deflate.h +377 -0
- package/dist/lib/runtime-sources/vendor/zlib/gzclose.c +23 -0
- package/dist/lib/runtime-sources/vendor/zlib/gzguts.h +214 -0
- package/dist/lib/runtime-sources/vendor/zlib/gzlib.c +582 -0
- package/dist/lib/runtime-sources/vendor/zlib/gzread.c +602 -0
- package/dist/lib/runtime-sources/vendor/zlib/gzwrite.c +631 -0
- package/dist/lib/runtime-sources/vendor/zlib/infback.c +628 -0
- package/dist/lib/runtime-sources/vendor/zlib/inffast.c +320 -0
- package/dist/lib/runtime-sources/vendor/zlib/inffast.h +11 -0
- package/dist/lib/runtime-sources/vendor/zlib/inffixed.h +94 -0
- package/dist/lib/runtime-sources/vendor/zlib/inflate.c +1526 -0
- package/dist/lib/runtime-sources/vendor/zlib/inflate.h +126 -0
- package/dist/lib/runtime-sources/vendor/zlib/inftrees.c +299 -0
- package/dist/lib/runtime-sources/vendor/zlib/inftrees.h +62 -0
- package/dist/lib/runtime-sources/vendor/zlib/trees.c +1117 -0
- package/dist/lib/runtime-sources/vendor/zlib/trees.h +128 -0
- package/dist/lib/runtime-sources/vendor/zlib/uncompr.c +85 -0
- package/dist/lib/runtime-sources/vendor/zlib/zconf.h +543 -0
- package/dist/lib/runtime-sources/vendor/zlib/zlib.h +1938 -0
- package/dist/lib/runtime-sources/vendor/zlib/zutil.c +299 -0
- package/dist/lib/runtime-sources/vendor/zlib/zutil.h +254 -0
- package/dist/lib/scriptc-comptime +0 -0
- package/dist/lib/typescript/LICENSE +55 -0
- package/dist/lib/typescript/NOTICE.txt +436 -0
- package/dist/lib/typescript/lib/lib.d.ts +20 -0
- package/dist/lib/typescript/lib/lib.decorators.d.ts +382 -0
- package/dist/lib/typescript/lib/lib.decorators.legacy.d.ts +20 -0
- package/dist/lib/typescript/lib/lib.dom.asynciterable.d.ts +18 -0
- package/dist/lib/typescript/lib/lib.dom.d.ts +45125 -0
- package/dist/lib/typescript/lib/lib.dom.iterable.d.ts +18 -0
- package/dist/lib/typescript/lib/lib.es2015.collection.d.ts +159 -0
- package/dist/lib/typescript/lib/lib.es2015.core.d.ts +595 -0
- package/dist/lib/typescript/lib/lib.es2015.d.ts +26 -0
- package/dist/lib/typescript/lib/lib.es2015.generator.d.ts +75 -0
- package/dist/lib/typescript/lib/lib.es2015.iterable.d.ts +603 -0
- package/dist/lib/typescript/lib/lib.es2015.promise.d.ts +79 -0
- package/dist/lib/typescript/lib/lib.es2015.proxy.d.ts +126 -0
- package/dist/lib/typescript/lib/lib.es2015.reflect.d.ts +142 -0
- package/dist/lib/typescript/lib/lib.es2015.symbol.d.ts +44 -0
- package/dist/lib/typescript/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/dist/lib/typescript/lib/lib.es2016.array.include.d.ts +114 -0
- package/dist/lib/typescript/lib/lib.es2016.d.ts +19 -0
- package/dist/lib/typescript/lib/lib.es2016.full.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.es2016.intl.d.ts +29 -0
- package/dist/lib/typescript/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/dist/lib/typescript/lib/lib.es2017.d.ts +24 -0
- package/dist/lib/typescript/lib/lib.es2017.date.d.ts +29 -0
- package/dist/lib/typescript/lib/lib.es2017.full.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.es2017.intl.d.ts +42 -0
- package/dist/lib/typescript/lib/lib.es2017.object.d.ts +47 -0
- package/dist/lib/typescript/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/dist/lib/typescript/lib/lib.es2017.string.d.ts +47 -0
- package/dist/lib/typescript/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/dist/lib/typescript/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/dist/lib/typescript/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/dist/lib/typescript/lib/lib.es2018.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2018.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2018.intl.d.ts +81 -0
- package/dist/lib/typescript/lib/lib.es2018.promise.d.ts +28 -0
- package/dist/lib/typescript/lib/lib.es2018.regexp.d.ts +35 -0
- package/dist/lib/typescript/lib/lib.es2019.array.d.ts +77 -0
- package/dist/lib/typescript/lib/lib.es2019.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2019.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2019.intl.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.es2019.object.d.ts +31 -0
- package/dist/lib/typescript/lib/lib.es2019.string.d.ts +35 -0
- package/dist/lib/typescript/lib/lib.es2019.symbol.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2020.bigint.d.ts +763 -0
- package/dist/lib/typescript/lib/lib.es2020.d.ts +25 -0
- package/dist/lib/typescript/lib/lib.es2020.date.d.ts +40 -0
- package/dist/lib/typescript/lib/lib.es2020.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2020.intl.d.ts +472 -0
- package/dist/lib/typescript/lib/lib.es2020.number.d.ts +26 -0
- package/dist/lib/typescript/lib/lib.es2020.promise.d.ts +45 -0
- package/dist/lib/typescript/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/dist/lib/typescript/lib/lib.es2020.string.d.ts +42 -0
- package/dist/lib/typescript/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/dist/lib/typescript/lib/lib.es2021.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.es2021.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2021.intl.d.ts +164 -0
- package/dist/lib/typescript/lib/lib.es2021.promise.d.ts +46 -0
- package/dist/lib/typescript/lib/lib.es2021.string.d.ts +31 -0
- package/dist/lib/typescript/lib/lib.es2021.weakref.d.ts +76 -0
- package/dist/lib/typescript/lib/lib.es2022.array.d.ts +119 -0
- package/dist/lib/typescript/lib/lib.es2022.d.ts +23 -0
- package/dist/lib/typescript/lib/lib.es2022.error.d.ts +73 -0
- package/dist/lib/typescript/lib/lib.es2022.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2022.intl.d.ts +143 -0
- package/dist/lib/typescript/lib/lib.es2022.object.d.ts +24 -0
- package/dist/lib/typescript/lib/lib.es2022.regexp.d.ts +37 -0
- package/dist/lib/typescript/lib/lib.es2022.string.d.ts +23 -0
- package/dist/lib/typescript/lib/lib.es2023.array.d.ts +922 -0
- package/dist/lib/typescript/lib/lib.es2023.collection.d.ts +19 -0
- package/dist/lib/typescript/lib/lib.es2023.d.ts +20 -0
- package/dist/lib/typescript/lib/lib.es2023.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2023.intl.d.ts +62 -0
- package/dist/lib/typescript/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/dist/lib/typescript/lib/lib.es2024.collection.d.ts +27 -0
- package/dist/lib/typescript/lib/lib.es2024.d.ts +24 -0
- package/dist/lib/typescript/lib/lib.es2024.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2024.object.d.ts +27 -0
- package/dist/lib/typescript/lib/lib.es2024.promise.d.ts +33 -0
- package/dist/lib/typescript/lib/lib.es2024.regexp.d.ts +23 -0
- package/dist/lib/typescript/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/dist/lib/typescript/lib/lib.es2024.string.d.ts +27 -0
- package/dist/lib/typescript/lib/lib.es2025.collection.d.ts +94 -0
- package/dist/lib/typescript/lib/lib.es2025.d.ts +23 -0
- package/dist/lib/typescript/lib/lib.es2025.float16.d.ts +443 -0
- package/dist/lib/typescript/lib/lib.es2025.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.es2025.intl.d.ts +200 -0
- package/dist/lib/typescript/lib/lib.es2025.iterator.d.ts +146 -0
- package/dist/lib/typescript/lib/lib.es2025.promise.d.ts +32 -0
- package/dist/lib/typescript/lib/lib.es2025.regexp.d.ts +30 -0
- package/dist/lib/typescript/lib/lib.es5.d.ts +4599 -0
- package/dist/lib/typescript/lib/lib.es6.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.esnext.array.d.ts +33 -0
- package/dist/lib/typescript/lib/lib.esnext.collection.d.ts +47 -0
- package/dist/lib/typescript/lib/lib.esnext.d.ts +27 -0
- package/dist/lib/typescript/lib/lib.esnext.date.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.esnext.decorators.d.ts +26 -0
- package/dist/lib/typescript/lib/lib.esnext.disposable.d.ts +191 -0
- package/dist/lib/typescript/lib/lib.esnext.error.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.esnext.full.d.ts +22 -0
- package/dist/lib/typescript/lib/lib.esnext.intl.d.ts +107 -0
- package/dist/lib/typescript/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/dist/lib/typescript/lib/lib.esnext.temporal.d.ts +485 -0
- package/dist/lib/typescript/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/dist/lib/typescript/lib/lib.scripthost.d.ts +320 -0
- package/dist/lib/typescript/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/dist/lib/typescript/lib/lib.webworker.d.ts +15606 -0
- package/dist/lib/typescript/lib/lib.webworker.importscripts.d.ts +21 -0
- package/dist/lib/typescript/lib/lib.webworker.iterable.d.ts +18 -0
- package/dist/lib/typescript/lib/tsc +0 -0
- package/dist/lib/typescript/package.json +45 -0
- package/dist/lib/wasi/cli/wasi-paths.js +41 -0
- package/dist/lib/wasi/cli/wasi-runner.js +28 -0
- package/dist/lib/wasi/package.json +1 -0
- package/dist/lib/wasi/wasi-paths.js +25 -0
- package/package.json +22 -6
- package/README.md +0 -3
- package/index.js +0 -2
|
@@ -0,0 +1,1222 @@
|
|
|
1
|
+
/* Process events and stdin streaming — the OPTIONAL half of the event
|
|
2
|
+
* loop: signal handlers (named process.on/once/off signal handlers), the
|
|
3
|
+
* process 'exit' event, and the piped-stdin surface ('data'/'end'/'error'
|
|
4
|
+
* listeners plus the for-await chunk source). This translation unit links
|
|
5
|
+
* ONLY into binaries whose IR uses those surfaces (moduleUsesProcessEvents
|
|
6
|
+
* — the scr_regex/scr_fetch/scr_zlib gating precedent), and the emitted
|
|
7
|
+
* main calls scr_events_install() before %main, which points the loop's
|
|
8
|
+
* nullable event hooks (scr_async.c) and scr_lib.c's process.exit /
|
|
9
|
+
* stdin.destroy hooks here. Programs that never touch these surfaces pay
|
|
10
|
+
* zero bytes and keep their exact historical link line. */
|
|
11
|
+
#define _XOPEN_SOURCE 700
|
|
12
|
+
#include "scr_runtime.h"
|
|
13
|
+
|
|
14
|
+
#include <errno.h>
|
|
15
|
+
#include <fcntl.h>
|
|
16
|
+
#include <signal.h>
|
|
17
|
+
#include <stdio.h>
|
|
18
|
+
#include <stdlib.h>
|
|
19
|
+
#include <string.h>
|
|
20
|
+
#include <math.h>
|
|
21
|
+
#ifdef _WIN32
|
|
22
|
+
/* The Windows arm: CRT signal() stands in for sigaction (msvcrt routes
|
|
23
|
+
* Ctrl-C/Ctrl-Break through its own SetConsoleCtrlHandler onto a separate
|
|
24
|
+
* thread and RESETS the disposition to SIG_DFL before each delivery — the
|
|
25
|
+
* handler re-arms itself), the readability probe is PeekNamedPipe /
|
|
26
|
+
* WaitForSingleObject instead of poll(2), and there is NO self-pipe: the
|
|
27
|
+
* loop's win32 idle sleep is the capped nanosleep in scr_async.c, so the
|
|
28
|
+
* handler's flag alone suffices and the cap bounds delivery latency.
|
|
29
|
+
* read(2) on fd 0 is mingw's CRT read — fd 0 is already _O_BINARY
|
|
30
|
+
* (scr_console.c's install). */
|
|
31
|
+
#include <io.h>
|
|
32
|
+
#include <unistd.h> /* mingw-w64 ships one: read */
|
|
33
|
+
#include <windows.h>
|
|
34
|
+
#elif defined(__wasi__)
|
|
35
|
+
#include <poll.h>
|
|
36
|
+
#include <unistd.h>
|
|
37
|
+
#else
|
|
38
|
+
#include <poll.h>
|
|
39
|
+
#include <unistd.h>
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
static void scr_events_oom(void) {
|
|
43
|
+
fputs("scriptc: out of memory\n", stderr);
|
|
44
|
+
abort();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#ifdef __wasi__
|
|
48
|
+
/* The native child unit normally owns these generic Error-listener adapters.
|
|
49
|
+
* WASI cannot spawn children and therefore does not link that unit, while
|
|
50
|
+
* stdin's error event intentionally shares the same adapter ABI. */
|
|
51
|
+
void scr_child_err_thunk0(ScrClosure *cb, ScrStr *msg) {
|
|
52
|
+
(void)msg;
|
|
53
|
+
((void (*)(ScrClosure *))cb->fn)(cb);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
void scr_child_err_thunk_error(ScrClosure *cb, ScrStr *msg) {
|
|
57
|
+
ScrError *error = scr_error_new(0 /* Error */, msg);
|
|
58
|
+
((void (*)(ScrClosure *, ScrError *))cb->fn)(cb, error);
|
|
59
|
+
}
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
/* ── process signal events (process.on(name, listener)) ─────────
|
|
63
|
+
* Classic self-pipe integration: a watched signal's sigaction handler
|
|
64
|
+
* (installed WITHOUT SA_RESTART) sets a per-signal flag and writes one
|
|
65
|
+
* byte into the wake pipe. The loop drains flags at every turn and the
|
|
66
|
+
* idle sleeps either get EINTR'd by the handler (nanosleep, kevent) or
|
|
67
|
+
* poll on the wake pipe directly, so a byte written before the sleep
|
|
68
|
+
* entered still wakes it — no lost-wakeup race. Listeners run on the main
|
|
69
|
+
* stack like timer callbacks (macrotasks). Node semantics matched:
|
|
70
|
+
* watching a signal replaces its default disposition (Ctrl-C no longer
|
|
71
|
+
* kills), removing the LAST listener restores it, `once` listeners are
|
|
72
|
+
* removed BEFORE they run, and signal listeners do NOT keep the loop
|
|
73
|
+
* alive — the exhaustion test ignores them, exactly Node. Multiple
|
|
74
|
+
* deliveries between two loop turns coalesce into one dispatch (the
|
|
75
|
+
* kernel coalesces pending non-RT signals the same way). */
|
|
76
|
+
|
|
77
|
+
typedef struct {
|
|
78
|
+
ScrDyn *cb; /* owned; checked callable */
|
|
79
|
+
ScrStr *name; /* aliases of one signum remain distinct event names */
|
|
80
|
+
bool once;
|
|
81
|
+
uint64_t id;
|
|
82
|
+
} ScrSigListener;
|
|
83
|
+
|
|
84
|
+
typedef struct ScrSigReg {
|
|
85
|
+
int sig;
|
|
86
|
+
#if defined(_WIN32) || defined(__wasi__)
|
|
87
|
+
void (*prev)(int); /* restored when the last listener leaves */
|
|
88
|
+
#else
|
|
89
|
+
struct sigaction prev; /* restored when the last listener leaves */
|
|
90
|
+
#endif
|
|
91
|
+
ScrSigListener *ls;
|
|
92
|
+
size_t n, cap;
|
|
93
|
+
struct ScrSigReg *next;
|
|
94
|
+
} ScrSigReg;
|
|
95
|
+
|
|
96
|
+
/* Every named classic POSIX signal fits; NSIG is hidden by strict
|
|
97
|
+
* _XOPEN_SOURCE. Unknown SIG-prefixed names use the unwatched slot zero. */
|
|
98
|
+
#define SCR_SIG_MAX 32
|
|
99
|
+
|
|
100
|
+
static ScrSigReg *scr_sig_regs = NULL;
|
|
101
|
+
static uint64_t scr_sig_id = 0;
|
|
102
|
+
static size_t scr_sig_watched = 0; /* watched signal COUNT (regs) */
|
|
103
|
+
static volatile sig_atomic_t scr_sig_flag[SCR_SIG_MAX];
|
|
104
|
+
static volatile sig_atomic_t scr_sig_any = 0;
|
|
105
|
+
static int scr_wake_pipe[2] = {-1, -1};
|
|
106
|
+
|
|
107
|
+
static void scr_sig_handler(int sig) {
|
|
108
|
+
if (sig <= 0 || sig >= SCR_SIG_MAX) return;
|
|
109
|
+
int saved_errno = errno;
|
|
110
|
+
#ifdef _WIN32
|
|
111
|
+
/* msvcrt reset the disposition to SIG_DFL before this call (SysV
|
|
112
|
+
* semantics); re-arm so the next delivery reaches us too. Only ever
|
|
113
|
+
* runs while a registration exists — dropping the last listener
|
|
114
|
+
* restores the previous disposition below. */
|
|
115
|
+
signal(sig, scr_sig_handler);
|
|
116
|
+
#endif
|
|
117
|
+
scr_sig_flag[sig] = 1;
|
|
118
|
+
scr_sig_any = 1;
|
|
119
|
+
if (scr_wake_pipe[1] >= 0) {
|
|
120
|
+
ssize_t ignored = write(scr_wake_pipe[1], "s", 1);
|
|
121
|
+
(void)ignored; /* a full pipe still wakes the poller */
|
|
122
|
+
}
|
|
123
|
+
errno = saved_errno;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
static void scr_sig_reg_drop(ScrSigReg *reg);
|
|
127
|
+
|
|
128
|
+
/* Half of the exit-time cleanup (registered by scr_events_install;
|
|
129
|
+
* atexit LIFO puts it BEFORE the RC audit): releases signal listeners a
|
|
130
|
+
* program legitimately leaves registered at exit — handlers installed for
|
|
131
|
+
* the process's whole life (the long-lived CLI shape), like Node — so the audit
|
|
132
|
+
* never mistakes them for leaks. */
|
|
133
|
+
static void scr_sig_cleanup(void) {
|
|
134
|
+
while (scr_sig_regs) {
|
|
135
|
+
ScrSigReg *reg = scr_sig_regs;
|
|
136
|
+
for (size_t i = 0; i < reg->n; i++) {
|
|
137
|
+
scr_dyn_release(reg->ls[i].cb);
|
|
138
|
+
scr_str_release(reg->ls[i].name);
|
|
139
|
+
}
|
|
140
|
+
reg->n = 0;
|
|
141
|
+
scr_sig_reg_drop(reg);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static void scr_wake_pipe_init(void) {
|
|
146
|
+
#if defined(_WIN32) || defined(__wasi__)
|
|
147
|
+
/* No self-pipe: the win32 loop never polls fds (scr_async.c's capped
|
|
148
|
+
* nanosleep takes the idle sleep), so the handler's flag is the whole
|
|
149
|
+
* wake path and the fds stay -1 — every pipe use below is guarded. */
|
|
150
|
+
return;
|
|
151
|
+
#else
|
|
152
|
+
if (scr_wake_pipe[0] >= 0) return;
|
|
153
|
+
if (pipe(scr_wake_pipe) != 0) {
|
|
154
|
+
scr_wake_pipe[0] = scr_wake_pipe[1] = -1;
|
|
155
|
+
return; /* sleeps still wake via EINTR; only the tiny race widens */
|
|
156
|
+
}
|
|
157
|
+
for (int i = 0; i < 2; i++) {
|
|
158
|
+
fcntl(scr_wake_pipe[i], F_SETFL, O_NONBLOCK);
|
|
159
|
+
fcntl(scr_wake_pipe[i], F_SETFD, FD_CLOEXEC);
|
|
160
|
+
}
|
|
161
|
+
#endif
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static void scr_wake_pipe_drain(void) {
|
|
165
|
+
if (scr_wake_pipe[0] < 0) return;
|
|
166
|
+
char buf[64];
|
|
167
|
+
while (read(scr_wake_pipe[0], buf, sizeof buf) > 0) {}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* A computed process-event name is accepted here only for the signal
|
|
171
|
+
* family. Other process-event families retain their explicit lowerings. */
|
|
172
|
+
static bool scr_signal_check(ScrStr *name, ScrDyn *cb) {
|
|
173
|
+
if (cb->kind != SCR_DYN_FUNC) {
|
|
174
|
+
const char *msg = "The \"listener\" argument must be of type function";
|
|
175
|
+
scr_throw_error_msg_code(SCR_ERR_TYPE, msg, strlen(msg), "ERR_INVALID_ARG_TYPE");
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
if (name->len < 3 || memcmp(name->data, "SIG", 3) != 0) {
|
|
179
|
+
const char *msg = "scriptc: computed process event names currently support the SIG signal family";
|
|
180
|
+
scr_throw_error_msg(SCR_ERR_ERROR, msg, strlen(msg));
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
void scr_signal_on(ScrStr *name, ScrDyn *cb, bool once) {
|
|
187
|
+
if (!scr_signal_check(name, cb)) return;
|
|
188
|
+
#ifdef __wasi__
|
|
189
|
+
(void)once;
|
|
190
|
+
scr_trap("scriptc: internal error: OS signal surface reached on WASI\n");
|
|
191
|
+
#else
|
|
192
|
+
int sig = scr_signal_from_name(name);
|
|
193
|
+
if (sig < 0) sig = 0; /* e.g. SIGBREAK on POSIX: ordinary inert event */
|
|
194
|
+
ScrSigReg *reg = scr_sig_regs;
|
|
195
|
+
while (reg && reg->sig != sig) reg = reg->next;
|
|
196
|
+
if (!reg) {
|
|
197
|
+
reg = calloc(1, sizeof *reg);
|
|
198
|
+
if (!reg) scr_events_oom();
|
|
199
|
+
reg->sig = sig;
|
|
200
|
+
if (sig > 0) {
|
|
201
|
+
bool failed = sig >= SCR_SIG_MAX;
|
|
202
|
+
#ifdef _WIN32
|
|
203
|
+
/* The Windows CRT rejects non-CRT signal numbers via its fatal
|
|
204
|
+
* invalid-parameter handler. Keep these forms explicitly fenced. */
|
|
205
|
+
if (sig != SIGINT && sig != SIGILL && sig != SIGABRT && sig != SIGFPE &&
|
|
206
|
+
sig != SIGSEGV && sig != SIGTERM && sig != SIGBREAK) failed = true;
|
|
207
|
+
if (!failed) {
|
|
208
|
+
reg->prev = signal(sig, scr_sig_handler);
|
|
209
|
+
failed = reg->prev == SIG_ERR;
|
|
210
|
+
}
|
|
211
|
+
#else
|
|
212
|
+
struct sigaction sa;
|
|
213
|
+
memset(&sa, 0, sizeof sa);
|
|
214
|
+
sa.sa_handler = scr_sig_handler;
|
|
215
|
+
sigemptyset(&sa.sa_mask);
|
|
216
|
+
if (!failed) failed = sigaction(sig, &sa, ®->prev) != 0;
|
|
217
|
+
#endif
|
|
218
|
+
if (failed) {
|
|
219
|
+
free(reg);
|
|
220
|
+
const char *msg = "uv_signal_start EINVAL";
|
|
221
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, msg, strlen(msg), "EINVAL");
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
scr_sig_watched++;
|
|
225
|
+
scr_wake_pipe_init();
|
|
226
|
+
}
|
|
227
|
+
reg->next = scr_sig_regs;
|
|
228
|
+
scr_sig_regs = reg;
|
|
229
|
+
}
|
|
230
|
+
if (reg->n == reg->cap) {
|
|
231
|
+
reg->cap = reg->cap ? reg->cap * 2 : 2;
|
|
232
|
+
reg->ls = realloc(reg->ls, reg->cap * sizeof *reg->ls);
|
|
233
|
+
if (!reg->ls) scr_events_oom();
|
|
234
|
+
}
|
|
235
|
+
reg->ls[reg->n++] = (ScrSigListener){scr_dyn_retain(cb), scr_str_retain(name), once, ++scr_sig_id};
|
|
236
|
+
#endif
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static void scr_sig_reg_drop(ScrSigReg *reg) {
|
|
240
|
+
if (reg->sig > 0) {
|
|
241
|
+
#ifdef _WIN32
|
|
242
|
+
signal(reg->sig, reg->prev);
|
|
243
|
+
#elif !defined(__wasi__)
|
|
244
|
+
sigaction(reg->sig, ®->prev, NULL);
|
|
245
|
+
#endif
|
|
246
|
+
scr_sig_watched--;
|
|
247
|
+
scr_sig_flag[reg->sig] = 0;
|
|
248
|
+
}
|
|
249
|
+
ScrSigReg **link = &scr_sig_regs;
|
|
250
|
+
while (*link != reg) link = &(*link)->next;
|
|
251
|
+
*link = reg->next;
|
|
252
|
+
free(reg->ls);
|
|
253
|
+
free(reg);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
static void scr_sig_remove(ScrSigReg *reg, size_t i) {
|
|
257
|
+
scr_dyn_release(reg->ls[i].cb);
|
|
258
|
+
scr_str_release(reg->ls[i].name);
|
|
259
|
+
memmove(reg->ls + i, reg->ls + i + 1, (reg->n - i - 1) * sizeof *reg->ls);
|
|
260
|
+
if (--reg->n == 0) scr_sig_reg_drop(reg);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
void scr_signal_off(ScrStr *name, ScrDyn *cb) {
|
|
264
|
+
if (!scr_signal_check(name, cb)) return;
|
|
265
|
+
int sig = scr_signal_from_name(name);
|
|
266
|
+
if (sig < 0) sig = 0;
|
|
267
|
+
ScrSigReg *reg = scr_sig_regs;
|
|
268
|
+
while (reg && reg->sig != sig) reg = reg->next;
|
|
269
|
+
if (!reg) return;
|
|
270
|
+
/* EventEmitter removes the most recently registered matching listener. */
|
|
271
|
+
for (size_t i = reg->n; i > 0; i--) {
|
|
272
|
+
ScrSigListener *l = ®->ls[i - 1];
|
|
273
|
+
if (scr_str_eq(l->name, name) && scr_dyn_strict_eq(l->cb, cb)) {
|
|
274
|
+
scr_sig_remove(reg, i - 1);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* Snapshot all pending deliveries before invoking user code. No live
|
|
281
|
+
* registry pointer survives a callback: off() can remove this signal or
|
|
282
|
+
* another pending signal and free either registry. */
|
|
283
|
+
static void scr_signals_drain(void) {
|
|
284
|
+
if (!scr_sig_any) return;
|
|
285
|
+
scr_sig_any = 0;
|
|
286
|
+
ScrSigListener *snap = NULL;
|
|
287
|
+
size_t n = 0;
|
|
288
|
+
for (ScrSigReg *reg = scr_sig_regs; reg; reg = reg->next) {
|
|
289
|
+
if (reg->sig <= 0 || !scr_sig_flag[reg->sig]) continue;
|
|
290
|
+
scr_sig_flag[reg->sig] = 0;
|
|
291
|
+
snap = realloc(snap, (n + reg->n) * sizeof *snap);
|
|
292
|
+
if (!snap) scr_events_oom();
|
|
293
|
+
for (size_t i = 0; i < reg->n; i++) {
|
|
294
|
+
snap[n] = reg->ls[i];
|
|
295
|
+
scr_dyn_retain(snap[n].cb);
|
|
296
|
+
scr_str_retain(snap[n].name);
|
|
297
|
+
n++;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
for (size_t i = 0; i < n; i++) {
|
|
301
|
+
if (!scr_exc_pending()) {
|
|
302
|
+
if (snap[i].once) {
|
|
303
|
+
for (ScrSigReg *reg = scr_sig_regs; reg; reg = reg->next) {
|
|
304
|
+
bool found = false;
|
|
305
|
+
for (size_t j = 0; j < reg->n; j++) {
|
|
306
|
+
if (reg->ls[j].id == snap[i].id) {
|
|
307
|
+
scr_sig_remove(reg, j);
|
|
308
|
+
found = true;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (found) break;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
ScrDyn *args[2] = {scr_dyn_new_str(snap[i].name), scr_dyn_new_num(scr_signal_from_name(snap[i].name))};
|
|
316
|
+
ScrDyn *result = scr_dyn_call(snap[i].cb, args, 2, "listener");
|
|
317
|
+
scr_dyn_release(result);
|
|
318
|
+
scr_dyn_release(args[0]);
|
|
319
|
+
scr_dyn_release(args[1]);
|
|
320
|
+
}
|
|
321
|
+
scr_dyn_release(snap[i].cb);
|
|
322
|
+
scr_str_release(snap[i].name);
|
|
323
|
+
}
|
|
324
|
+
free(snap);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* ── process.stdin events and async iteration ─────────────────────────
|
|
328
|
+
* The honest piped-stdin slice: 'data'/'end'/'error' listeners (on/once)
|
|
329
|
+
* and the for-await chunk source. fd 0 is watched with poll(2) only
|
|
330
|
+
* while a CONSUMER exists — a 'data' listener or a parked for-await
|
|
331
|
+
* chunk promise — which is also the loop's keep-alive test: Node keeps
|
|
332
|
+
* the process alive for a flowing stdin and lets it exit once nothing
|
|
333
|
+
* consumes. One poll wake = one read(2) = one chunk (up to 64KB, like
|
|
334
|
+
* libuv's pipe reads); EOF fires 'end' (once semantics respected),
|
|
335
|
+
* settles a parked chunk promise with the EMPTY sentinel, and drops the
|
|
336
|
+
* remaining listeners — after 'end' nothing fires again. destroy()
|
|
337
|
+
* tears everything down the same way (Node's destroyed stream delivers
|
|
338
|
+
* nothing more; a for-await running at destroy time ends instead of
|
|
339
|
+
* throwing Node's premature-close error — documented divergence). A
|
|
340
|
+
* read(2) failure fires 'error' listeners (the Error is built by the
|
|
341
|
+
* child err adapters — same shape) and then ends the stream; with no
|
|
342
|
+
* listener it is treated as EOF (piped fd 0 read errors are not
|
|
343
|
+
* meaningfully reachable). */
|
|
344
|
+
|
|
345
|
+
typedef struct {
|
|
346
|
+
ScrClosure *cb; /* owned */
|
|
347
|
+
void (*fn)(ScrClosure *cb, ScrBytes *chunk); /* adapter: chunk borrowed */
|
|
348
|
+
bool once;
|
|
349
|
+
} ScrStdinDataL;
|
|
350
|
+
|
|
351
|
+
typedef struct {
|
|
352
|
+
ScrClosure *cb; /* owned */
|
|
353
|
+
bool once;
|
|
354
|
+
} ScrStdinEndL;
|
|
355
|
+
|
|
356
|
+
typedef struct {
|
|
357
|
+
ScrClosure *cb; /* owned */
|
|
358
|
+
ScrChildErrFn fn; /* the child error adapters fit exactly */
|
|
359
|
+
bool once;
|
|
360
|
+
} ScrStdinErrL;
|
|
361
|
+
|
|
362
|
+
static ScrStdinDataL *scr_stdin_data = NULL;
|
|
363
|
+
static size_t scr_stdin_ndata = 0, scr_stdin_data_cap = 0;
|
|
364
|
+
static ScrStdinEndL *scr_stdin_end = NULL;
|
|
365
|
+
static size_t scr_stdin_nend = 0, scr_stdin_end_cap = 0;
|
|
366
|
+
static ScrStdinErrL *scr_stdin_err = NULL;
|
|
367
|
+
static size_t scr_stdin_nerr = 0, scr_stdin_err_cap = 0;
|
|
368
|
+
static ScrPromise *scr_stdin_waiter = NULL; /* parked for-await next() */
|
|
369
|
+
static bool scr_stdin_eof = false;
|
|
370
|
+
static bool scr_stdin_destroyed = false;
|
|
371
|
+
static bool scr_stdin_paused = false;
|
|
372
|
+
static bool scr_stdin_resumed = false;
|
|
373
|
+
static bool scr_stdin_read_eof = false;
|
|
374
|
+
static ScrBytes *scr_stdin_buffer;
|
|
375
|
+
static size_t scr_stdin_read_demand;
|
|
376
|
+
|
|
377
|
+
void scr_stdin_on_data(ScrClosure *cb /*moves*/, void (*fn)(ScrClosure *, ScrBytes *),
|
|
378
|
+
bool once) {
|
|
379
|
+
if (scr_stdin_eof || scr_stdin_destroyed) {
|
|
380
|
+
scr_closure_release(cb); /* never fires again, like Node post-'end' */
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (scr_stdin_ndata == scr_stdin_data_cap) {
|
|
384
|
+
scr_stdin_data_cap = scr_stdin_data_cap ? scr_stdin_data_cap * 2 : 2;
|
|
385
|
+
scr_stdin_data = realloc(scr_stdin_data, scr_stdin_data_cap * sizeof *scr_stdin_data);
|
|
386
|
+
if (!scr_stdin_data) scr_events_oom();
|
|
387
|
+
}
|
|
388
|
+
scr_stdin_data[scr_stdin_ndata].cb = cb;
|
|
389
|
+
scr_stdin_data[scr_stdin_ndata].fn = fn;
|
|
390
|
+
scr_stdin_data[scr_stdin_ndata].once = once;
|
|
391
|
+
scr_stdin_ndata++;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
void scr_stdin_on_end(ScrClosure *cb /*moves*/, bool once) {
|
|
395
|
+
if (scr_stdin_eof || scr_stdin_destroyed) {
|
|
396
|
+
scr_closure_release(cb);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (scr_stdin_nend == scr_stdin_end_cap) {
|
|
400
|
+
scr_stdin_end_cap = scr_stdin_end_cap ? scr_stdin_end_cap * 2 : 2;
|
|
401
|
+
scr_stdin_end = realloc(scr_stdin_end, scr_stdin_end_cap * sizeof *scr_stdin_end);
|
|
402
|
+
if (!scr_stdin_end) scr_events_oom();
|
|
403
|
+
}
|
|
404
|
+
scr_stdin_end[scr_stdin_nend].cb = cb;
|
|
405
|
+
scr_stdin_end[scr_stdin_nend].once = once;
|
|
406
|
+
scr_stdin_nend++;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
void scr_stdin_on_error(ScrClosure *cb /*moves*/, ScrChildErrFn fn, bool once) {
|
|
410
|
+
if (scr_stdin_eof || scr_stdin_destroyed) {
|
|
411
|
+
scr_closure_release(cb);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (scr_stdin_nerr == scr_stdin_err_cap) {
|
|
415
|
+
scr_stdin_err_cap = scr_stdin_err_cap ? scr_stdin_err_cap * 2 : 2;
|
|
416
|
+
scr_stdin_err = realloc(scr_stdin_err, scr_stdin_err_cap * sizeof *scr_stdin_err);
|
|
417
|
+
if (!scr_stdin_err) scr_events_oom();
|
|
418
|
+
}
|
|
419
|
+
scr_stdin_err[scr_stdin_nerr].cb = cb;
|
|
420
|
+
scr_stdin_err[scr_stdin_nerr].fn = fn;
|
|
421
|
+
scr_stdin_err[scr_stdin_nerr].once = once;
|
|
422
|
+
scr_stdin_nerr++;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/* Removal by closure identity — node:readline's close() detaches its
|
|
426
|
+
* shared consumer so the loop stops waiting on fd 0 (Node's
|
|
427
|
+
* pause-on-close). Safe mid-dispatch: the service pass runs over a
|
|
428
|
+
* snapshot, exactly like the once-removal. No-op for unknown closures. */
|
|
429
|
+
void scr_stdin_remove_data(ScrClosure *cb) {
|
|
430
|
+
for (size_t j = 0; j < scr_stdin_ndata; j++) {
|
|
431
|
+
if (scr_stdin_data[j].cb == cb) {
|
|
432
|
+
scr_closure_release(scr_stdin_data[j].cb);
|
|
433
|
+
memmove(scr_stdin_data + j, scr_stdin_data + j + 1,
|
|
434
|
+
(scr_stdin_ndata - j - 1) * sizeof *scr_stdin_data);
|
|
435
|
+
scr_stdin_ndata--;
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/* True once the stream can never deliver again (EOF seen, or destroyed) —
|
|
442
|
+
* node:readline's created-after-the-end probe. */
|
|
443
|
+
bool scr_stdin_ended(void) { return scr_stdin_eof || scr_stdin_destroyed; }
|
|
444
|
+
|
|
445
|
+
/* The loop keep-alive/watch predicate: a consumer exists and the stream
|
|
446
|
+
* can still deliver. 'end'/'error' listeners alone do not keep the loop
|
|
447
|
+
* alive (a paused Node stdin with only those never flows — the process
|
|
448
|
+
* exits with them registered). */
|
|
449
|
+
static bool scr_stdin_watching(void) {
|
|
450
|
+
return !scr_stdin_eof && !scr_stdin_destroyed &&
|
|
451
|
+
((!scr_stdin_paused && (scr_stdin_ndata > 0 || scr_stdin_resumed)) ||
|
|
452
|
+
scr_stdin_waiter != NULL ||
|
|
453
|
+
(!scr_stdin_read_eof && scr_stdin_read_demand > (scr_stdin_buffer ? scr_stdin_buffer->len : 0)));
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
bool scr_stdin_pending(void) { return scr_stdin_watching(); }
|
|
457
|
+
|
|
458
|
+
static void scr_stdin_drop_listeners(void) {
|
|
459
|
+
for (size_t i = 0; i < scr_stdin_ndata; i++) scr_closure_release(scr_stdin_data[i].cb);
|
|
460
|
+
for (size_t i = 0; i < scr_stdin_nend; i++) scr_closure_release(scr_stdin_end[i].cb);
|
|
461
|
+
for (size_t i = 0; i < scr_stdin_nerr; i++) scr_closure_release(scr_stdin_err[i].cb);
|
|
462
|
+
free(scr_stdin_data);
|
|
463
|
+
free(scr_stdin_end);
|
|
464
|
+
free(scr_stdin_err);
|
|
465
|
+
scr_stdin_data = NULL;
|
|
466
|
+
scr_stdin_end = NULL;
|
|
467
|
+
scr_stdin_err = NULL;
|
|
468
|
+
scr_stdin_ndata = scr_stdin_nend = scr_stdin_nerr = 0;
|
|
469
|
+
scr_stdin_data_cap = scr_stdin_end_cap = scr_stdin_err_cap = 0;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* Settles the parked for-await promise with the empty DONE sentinel (a
|
|
473
|
+
* POSIX read never delivers an empty data chunk, so the sentinel cannot
|
|
474
|
+
* collide with real data). */
|
|
475
|
+
static void scr_stdin_settle_done(void) {
|
|
476
|
+
if (!scr_stdin_waiter) return;
|
|
477
|
+
ScrPromise *p = scr_stdin_waiter;
|
|
478
|
+
scr_stdin_waiter = NULL;
|
|
479
|
+
ScrBytes *empty = scr_bytes_new(SCR_BYTES_U8, 0);
|
|
480
|
+
scr_promise_fulfill_ref(p, empty, scr_bytes_retain_v, scr_bytes_release_v, NULL);
|
|
481
|
+
scr_promise_release(p);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* EOF/teardown shared tail: 'end' fires (snapshot; once semantics are
|
|
485
|
+
* moot — everything drops right after), the parked promise settles done,
|
|
486
|
+
* and every listener is released. */
|
|
487
|
+
static void scr_stdin_finish(bool fire_end) {
|
|
488
|
+
scr_stdin_eof = true;
|
|
489
|
+
if (fire_end) {
|
|
490
|
+
size_t n = scr_stdin_nend;
|
|
491
|
+
ScrStdinEndL *snap = malloc(n * sizeof *snap);
|
|
492
|
+
if (!snap) scr_events_oom();
|
|
493
|
+
for (size_t i = 0; i < n; i++) {
|
|
494
|
+
snap[i] = scr_stdin_end[i];
|
|
495
|
+
scr_closure_retain(snap[i].cb);
|
|
496
|
+
}
|
|
497
|
+
for (size_t i = 0; i < n; i++) {
|
|
498
|
+
if (!scr_exc_pending()) {
|
|
499
|
+
((void (*)(ScrClosure *))snap[i].cb->fn)(snap[i].cb);
|
|
500
|
+
}
|
|
501
|
+
scr_closure_release(snap[i].cb);
|
|
502
|
+
}
|
|
503
|
+
free(snap);
|
|
504
|
+
}
|
|
505
|
+
scr_stdin_settle_done();
|
|
506
|
+
scr_stdin_drop_listeners();
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/* process.stdin.destroy(): tear the stream down — nothing fires after,
|
|
510
|
+
* the loop stops watching, and a parked for-await ends. */
|
|
511
|
+
void scr_stdin_destroy(void) {
|
|
512
|
+
if (scr_stdin_destroyed) return;
|
|
513
|
+
scr_stdin_destroyed = true;
|
|
514
|
+
scr_bytes_release(scr_stdin_buffer);
|
|
515
|
+
scr_stdin_buffer = NULL;
|
|
516
|
+
scr_stdin_read_demand = 0;
|
|
517
|
+
scr_stdin_settle_done();
|
|
518
|
+
scr_stdin_drop_listeners();
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/* The for-await chunk source: a +1 promise of the NEXT chunk (fulfilled
|
|
522
|
+
* from the poll wake), or of the empty done sentinel at EOF/teardown.
|
|
523
|
+
* One parked promise at a time — concurrent iterations of process.stdin
|
|
524
|
+
* would share deliveries (nothing real does this). */
|
|
525
|
+
ScrPromise *scr_stdin_next_chunk(void) {
|
|
526
|
+
if (scr_stdin_eof || scr_stdin_destroyed) {
|
|
527
|
+
ScrPromise *p = scr_promise_new();
|
|
528
|
+
ScrBytes *empty = scr_bytes_new(SCR_BYTES_U8, 0);
|
|
529
|
+
scr_promise_fulfill_ref(p, empty, scr_bytes_retain_v, scr_bytes_release_v, NULL);
|
|
530
|
+
return p;
|
|
531
|
+
}
|
|
532
|
+
if (!scr_stdin_waiter) scr_stdin_waiter = scr_promise_new();
|
|
533
|
+
return scr_promise_retain(scr_stdin_waiter);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* One service pass, called at loop turns while watching: a zero-timeout
|
|
537
|
+
* poll probes readability (the idle sleep already waited on fd 0), one
|
|
538
|
+
* read(2) takes what arrived, and the chunk goes to the 'data' listeners
|
|
539
|
+
* (snapshot; `once` entries leave the live list before running) — or,
|
|
540
|
+
* with no listener, to the parked for-await promise. Node's stream would
|
|
541
|
+
* buffer a chunk nobody consumes; this slice never reads without a
|
|
542
|
+
* consumer, so the pipe itself is the buffer (backpressure, not loss). */
|
|
543
|
+
static void scr_stdin_deliver(ScrBytes *chunk);
|
|
544
|
+
|
|
545
|
+
static void scr_stdin_service(void) {
|
|
546
|
+
if (!scr_stdin_watching()) return;
|
|
547
|
+
if (!scr_stdin_paused && scr_stdin_buffer) {
|
|
548
|
+
ScrBytes *chunk = scr_stdin_buffer;
|
|
549
|
+
scr_stdin_buffer = NULL;
|
|
550
|
+
scr_stdin_deliver(chunk);
|
|
551
|
+
scr_bytes_release(chunk);
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (scr_stdin_read_eof) {
|
|
555
|
+
if (!scr_stdin_buffer) scr_stdin_finish(true);
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
#ifdef _WIN32
|
|
559
|
+
/* The poll(2)-probe's win32 spelling, by handle type: a PIPE (the
|
|
560
|
+
* harness/ssh shape) answers PeekNamedPipe — bytes available, or a
|
|
561
|
+
* FALSE return once the writer closed (broken pipe), where read(2)
|
|
562
|
+
* below delivers the EOF; a CONSOLE answers a zero-timeout wait on the
|
|
563
|
+
* input handle (cooked mode — a read may still block until Enter, the
|
|
564
|
+
* interactive line-buffering Node's cooked stdin shows too); disk
|
|
565
|
+
* files are always readable. A missing handle falls through to read,
|
|
566
|
+
* whose 0/-1 ends the stream. */
|
|
567
|
+
HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
|
|
568
|
+
if (h != NULL && h != INVALID_HANDLE_VALUE) {
|
|
569
|
+
DWORD type = GetFileType(h);
|
|
570
|
+
if (type == FILE_TYPE_PIPE) {
|
|
571
|
+
DWORD avail = 0;
|
|
572
|
+
if (PeekNamedPipe(h, NULL, 0, NULL, &avail, NULL) && avail == 0) return;
|
|
573
|
+
} else if (type == FILE_TYPE_CHAR) {
|
|
574
|
+
if (WaitForSingleObject(h, 0) != WAIT_OBJECT_0) return;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
#elif defined(__wasi__)
|
|
578
|
+
/* install() puts fd 0 in nonblocking mode, so a direct read is both the
|
|
579
|
+
* readiness probe and the operation. This also observes a closed pipe on
|
|
580
|
+
* WASI hosts whose poll_oneoff adapter does not report POLLHUP. */
|
|
581
|
+
#else
|
|
582
|
+
struct pollfd pfd = {0 /* stdin */, POLLIN, 0};
|
|
583
|
+
int rc = poll(&pfd, 1, 0);
|
|
584
|
+
if (rc <= 0 || !(pfd.revents & (POLLIN | POLLHUP | POLLERR))) return;
|
|
585
|
+
#endif
|
|
586
|
+
char buf[65536];
|
|
587
|
+
ssize_t n = read(0, buf, sizeof buf);
|
|
588
|
+
if (n < 0) {
|
|
589
|
+
if (errno == EINTR || errno == EAGAIN) return;
|
|
590
|
+
/* Real read failure: 'error' listeners get Node's Error shape via the
|
|
591
|
+
* child adapters; the stream then ends silently (no 'end' after
|
|
592
|
+
* 'error', like Node). No listener: treated as EOF. */
|
|
593
|
+
if (scr_stdin_nerr > 0) {
|
|
594
|
+
char msg[64];
|
|
595
|
+
snprintf(msg, sizeof msg, "read E%d", errno);
|
|
596
|
+
ScrStr *m = scr_str_new(msg, strlen(msg));
|
|
597
|
+
size_t nl = scr_stdin_nerr;
|
|
598
|
+
ScrStdinErrL *snap = malloc(nl * sizeof *snap);
|
|
599
|
+
if (!snap) scr_events_oom();
|
|
600
|
+
for (size_t i = 0; i < nl; i++) {
|
|
601
|
+
snap[i] = scr_stdin_err[i];
|
|
602
|
+
scr_closure_retain(snap[i].cb);
|
|
603
|
+
}
|
|
604
|
+
for (size_t i = 0; i < nl; i++) {
|
|
605
|
+
if (!scr_exc_pending()) snap[i].fn(snap[i].cb, m);
|
|
606
|
+
scr_closure_release(snap[i].cb);
|
|
607
|
+
}
|
|
608
|
+
free(snap);
|
|
609
|
+
scr_str_release(m);
|
|
610
|
+
scr_stdin_finish(false);
|
|
611
|
+
} else {
|
|
612
|
+
scr_stdin_finish(true);
|
|
613
|
+
}
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
if (n == 0) {
|
|
617
|
+
scr_stdin_read_eof = true;
|
|
618
|
+
if (!scr_stdin_buffer) scr_stdin_finish(true);
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
ScrBytes *chunk = scr_bytes_new(SCR_BYTES_U8, (double)n);
|
|
622
|
+
memcpy(chunk->data, buf, (size_t)n);
|
|
623
|
+
if (scr_stdin_paused || (!scr_stdin_ndata && !scr_stdin_resumed && !scr_stdin_waiter)) {
|
|
624
|
+
if (scr_stdin_buffer) {
|
|
625
|
+
size_t before = scr_stdin_buffer->len;
|
|
626
|
+
ScrBytes *joined = scr_bytes_new(SCR_BYTES_U8, (double)(before + (size_t)n));
|
|
627
|
+
memcpy(joined->data, scr_stdin_buffer->data, before);
|
|
628
|
+
memcpy(joined->data + before, buf, (size_t)n);
|
|
629
|
+
scr_bytes_release(scr_stdin_buffer);
|
|
630
|
+
scr_bytes_release(chunk);
|
|
631
|
+
scr_stdin_buffer = joined;
|
|
632
|
+
} else scr_stdin_buffer = chunk;
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
scr_stdin_deliver(chunk);
|
|
636
|
+
scr_bytes_release(chunk);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
static void scr_stdin_deliver(ScrBytes *chunk) {
|
|
640
|
+
if (scr_stdin_ndata > 0) {
|
|
641
|
+
size_t nd = scr_stdin_ndata;
|
|
642
|
+
ScrStdinDataL *snap = malloc(nd * sizeof *snap);
|
|
643
|
+
if (!snap) scr_events_oom();
|
|
644
|
+
for (size_t i = 0; i < nd; i++) {
|
|
645
|
+
snap[i] = scr_stdin_data[i];
|
|
646
|
+
scr_closure_retain(snap[i].cb);
|
|
647
|
+
}
|
|
648
|
+
for (size_t i = 0; i < nd; i++) {
|
|
649
|
+
if (snap[i].once) {
|
|
650
|
+
for (size_t j = 0; j < scr_stdin_ndata; j++) {
|
|
651
|
+
if (scr_stdin_data[j].cb == snap[i].cb) {
|
|
652
|
+
scr_closure_release(scr_stdin_data[j].cb);
|
|
653
|
+
memmove(scr_stdin_data + j, scr_stdin_data + j + 1,
|
|
654
|
+
(scr_stdin_ndata - j - 1) * sizeof *scr_stdin_data);
|
|
655
|
+
scr_stdin_ndata--;
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
if (!scr_exc_pending()) snap[i].fn(snap[i].cb, chunk);
|
|
661
|
+
scr_closure_release(snap[i].cb);
|
|
662
|
+
}
|
|
663
|
+
free(snap);
|
|
664
|
+
} else if (scr_stdin_waiter) {
|
|
665
|
+
ScrPromise *p = scr_stdin_waiter;
|
|
666
|
+
scr_stdin_waiter = NULL;
|
|
667
|
+
scr_promise_fulfill_ref(p, scr_bytes_retain(chunk), scr_bytes_retain_v,
|
|
668
|
+
scr_bytes_release_v, NULL);
|
|
669
|
+
scr_promise_release(p);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* First-class process streams share the same fd identities and input loop
|
|
674
|
+
* as direct process calls. Their method values are native closures, so a
|
|
675
|
+
* saved write method can be invoked with .call after write is replaced. */
|
|
676
|
+
typedef struct {
|
|
677
|
+
int fd;
|
|
678
|
+
ScrDyn *write;
|
|
679
|
+
ScrDyn **errors;
|
|
680
|
+
bool *error_once;
|
|
681
|
+
size_t nerrors;
|
|
682
|
+
ScrDyn *write_error;
|
|
683
|
+
} ScrStdio;
|
|
684
|
+
|
|
685
|
+
static ScrStdio scr_stdio_streams[3] = {{.fd = 0}, {.fd = 1}, {.fd = 2}};
|
|
686
|
+
enum { STDIO_WRITE, STDIO_ON, STDIO_ONCE, STDIO_OFF, STDIO_PAUSE, STDIO_RESUME,
|
|
687
|
+
STDIO_IS_PAUSED, STDIO_READ, STDIO_RAW, STDIO_DESTROY, STDIO_METHOD_COUNT };
|
|
688
|
+
static const char *const scr_stdio_names[] = {
|
|
689
|
+
"write", "on", "once", "removeListener", "pause", "resume", "isPaused", "read", "setRawMode", "destroy"
|
|
690
|
+
};
|
|
691
|
+
static ScrDyn *scr_stdio_methods[STDIO_METHOD_COUNT];
|
|
692
|
+
static bool scr_stdio_initialized;
|
|
693
|
+
static bool scr_stdio_raw;
|
|
694
|
+
|
|
695
|
+
static ScrDyn *scr_stdio_refusal(const char *name) {
|
|
696
|
+
char message[192];
|
|
697
|
+
int length = snprintf(message, sizeof message, "Native process stream %s has no lowering [SC2020]", name);
|
|
698
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, (size_t)length, "SC2020");
|
|
699
|
+
return NULL;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
static ScrDyn *scr_stdio_listener(ScrClosure *cb) { return scr_box_get_ref(cb->caps[0]); }
|
|
703
|
+
|
|
704
|
+
static void scr_stdio_fire(ScrClosure *cb, ScrDyn *arg, size_t argc) {
|
|
705
|
+
ScrDyn *fn = scr_stdio_listener(cb);
|
|
706
|
+
scr_dyn_this_push(&scr_stdio_streams[0], SCR_DYNH_STDIO);
|
|
707
|
+
ScrDyn *result = scr_dyn_call(fn, &arg, argc, "stdin listener");
|
|
708
|
+
scr_dyn_this_pop();
|
|
709
|
+
scr_dyn_release(result);
|
|
710
|
+
scr_dyn_release(fn);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
static void scr_stdio_data(ScrClosure *cb, ScrBytes *bytes) {
|
|
714
|
+
ScrDyn *chunk = scr_dyn_new_chunk(bytes);
|
|
715
|
+
scr_stdio_fire(cb, chunk, 1);
|
|
716
|
+
scr_dyn_release(chunk);
|
|
717
|
+
}
|
|
718
|
+
static void scr_stdio_end(ScrClosure *cb) { scr_stdio_fire(cb, NULL, 0); }
|
|
719
|
+
static void scr_stdio_error(ScrClosure *cb, ScrStr *message) {
|
|
720
|
+
ScrError *error = scr_error_new(SCR_ERR_ERROR, message);
|
|
721
|
+
ScrDyn *arg = scr_dyn_from_error(error);
|
|
722
|
+
scr_error_release(error);
|
|
723
|
+
scr_stdio_fire(cb, arg, 1);
|
|
724
|
+
scr_dyn_release(arg);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
static ScrClosure *scr_stdio_callback(ScrDyn *fn, void *fire) {
|
|
728
|
+
ScrClosure *cb = scr_closure_new(fire, 1);
|
|
729
|
+
cb->caps[0] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
730
|
+
scr_box_set_ref(cb->caps[0], scr_dyn_retain(fn));
|
|
731
|
+
return cb;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
static bool scr_stdio_matches(ScrClosure *cb, void *fire, ScrDyn *fn) {
|
|
735
|
+
if (cb->fn != fire) return false;
|
|
736
|
+
ScrDyn *registered = scr_stdio_listener(cb);
|
|
737
|
+
bool matches = scr_dyn_strict_eq(registered, fn);
|
|
738
|
+
scr_dyn_release(registered);
|
|
739
|
+
return matches;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
static void scr_stdio_write_done(ScrClosure *cb) {
|
|
743
|
+
ScrDyn *fn = scr_stdio_listener(cb);
|
|
744
|
+
ScrDyn *arg = scr_dyn_new_null();
|
|
745
|
+
ScrDyn *result = scr_dyn_call(fn, &arg, 1, "write callback");
|
|
746
|
+
scr_dyn_release(result);
|
|
747
|
+
scr_dyn_release(fn);
|
|
748
|
+
scr_dyn_release(arg);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
static void scr_stdio_write_failed(ScrClosure *cb) {
|
|
752
|
+
ScrDyn *callback = scr_box_get_ref(cb->caps[0]);
|
|
753
|
+
ScrDyn *error = scr_box_get_ref(cb->caps[1]);
|
|
754
|
+
ScrStdio *stream = &scr_stdio_streams[(int)scr_box_get_f64(cb->caps[2])];
|
|
755
|
+
if (callback->kind == SCR_DYN_FUNC) {
|
|
756
|
+
ScrDyn *result = scr_dyn_call(callback, &error, 1, "write callback");
|
|
757
|
+
scr_dyn_release(result);
|
|
758
|
+
}
|
|
759
|
+
if (!scr_exc_pending()) {
|
|
760
|
+
size_t count = stream->nerrors;
|
|
761
|
+
ScrDyn **listeners = count ? malloc(count * sizeof *listeners) : NULL;
|
|
762
|
+
if (count && !listeners) scr_events_oom();
|
|
763
|
+
size_t kept = 0;
|
|
764
|
+
for (size_t i = 0; i < count; i++) {
|
|
765
|
+
listeners[i] = scr_dyn_retain(stream->errors[i]);
|
|
766
|
+
if (stream->error_once[i]) scr_dyn_release(stream->errors[i]);
|
|
767
|
+
else {
|
|
768
|
+
stream->errors[kept] = stream->errors[i];
|
|
769
|
+
stream->error_once[kept++] = false;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
stream->nerrors = kept;
|
|
773
|
+
if (!count) scr_throw_ref(scr_dyn_retain(error), scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
774
|
+
for (size_t i = 0; i < count; i++) {
|
|
775
|
+
if (!scr_exc_pending()) {
|
|
776
|
+
scr_dyn_this_push(stream, SCR_DYNH_STDIO);
|
|
777
|
+
ScrDyn *result = scr_dyn_call(listeners[i], &error, 1, "error listener");
|
|
778
|
+
scr_dyn_this_pop();
|
|
779
|
+
scr_dyn_release(result);
|
|
780
|
+
}
|
|
781
|
+
scr_dyn_release(listeners[i]);
|
|
782
|
+
}
|
|
783
|
+
free(listeners);
|
|
784
|
+
}
|
|
785
|
+
scr_dyn_release(callback);
|
|
786
|
+
scr_dyn_release(error);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
static void scr_stdio_queue_write_error(ScrStdio *stream, ScrDyn *callback, int code) {
|
|
790
|
+
if (!stream->write_error) {
|
|
791
|
+
const char *name = code == EPIPE ? "EPIPE" : code == EBADF ? "EBADF" : "EIO";
|
|
792
|
+
char message[64];
|
|
793
|
+
int length = snprintf(message, sizeof message, "write %s", name);
|
|
794
|
+
ScrStr *text = scr_str_new(message, (size_t)length);
|
|
795
|
+
ScrError *error = scr_error_new(SCR_ERR_ERROR, text);
|
|
796
|
+
scr_str_release(text);
|
|
797
|
+
scr_error_set_code(error, name);
|
|
798
|
+
stream->write_error = scr_dyn_from_error(error);
|
|
799
|
+
scr_error_release(error);
|
|
800
|
+
}
|
|
801
|
+
ScrClosure *cb = scr_closure_new((void *)scr_stdio_write_failed, 3);
|
|
802
|
+
cb->caps[0] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
803
|
+
scr_box_set_ref(cb->caps[0], scr_dyn_retain(callback));
|
|
804
|
+
cb->caps[1] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
805
|
+
scr_box_set_ref(cb->caps[1], scr_dyn_retain(stream->write_error));
|
|
806
|
+
cb->caps[2] = scr_box_new(SCR_BOX_F64);
|
|
807
|
+
scr_box_set_f64(cb->caps[2], stream->fd);
|
|
808
|
+
scr_next_tick(cb);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
static void scr_stdio_finish_read(void) {
|
|
812
|
+
if (scr_stdin_read_eof && !scr_stdin_buffer && !scr_stdin_eof && !scr_stdin_destroyed)
|
|
813
|
+
scr_stdin_finish(true);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
static ScrDyn *scr_stdio_read(ScrDyn *size) {
|
|
817
|
+
bool all = size->kind == SCR_DYN_UNDEF;
|
|
818
|
+
if (!all && (size->kind != SCR_DYN_NUM || !isfinite(size->v.num) ||
|
|
819
|
+
size->v.num < 0 || size->v.num > 1073741824 || floor(size->v.num) != size->v.num))
|
|
820
|
+
return scr_stdio_refusal("read size");
|
|
821
|
+
size_t available = scr_stdin_buffer ? scr_stdin_buffer->len : 0;
|
|
822
|
+
size_t wanted = all ? available : (size_t)size->v.num;
|
|
823
|
+
if (scr_stdin_read_eof && wanted > available) wanted = available;
|
|
824
|
+
if (wanted == 0 || wanted > available) {
|
|
825
|
+
if (!scr_stdin_eof && !scr_stdin_destroyed) {
|
|
826
|
+
scr_stdin_read_demand = wanted > 65536 ? wanted : 65536;
|
|
827
|
+
if (scr_stdin_read_eof) scr_next_tick_raw(scr_stdio_finish_read);
|
|
828
|
+
}
|
|
829
|
+
return scr_dyn_new_null();
|
|
830
|
+
}
|
|
831
|
+
ScrBytes *chunk = scr_bytes_slice(scr_stdin_buffer, 0, (double)wanted);
|
|
832
|
+
ScrBytes *rest = wanted < available ? scr_bytes_slice(scr_stdin_buffer, (double)wanted, (double)available) : NULL;
|
|
833
|
+
scr_bytes_release(scr_stdin_buffer);
|
|
834
|
+
scr_stdin_buffer = rest;
|
|
835
|
+
scr_stdin_read_demand = 65536;
|
|
836
|
+
scr_stdin_deliver(chunk);
|
|
837
|
+
ScrDyn *result = scr_dyn_new_chunk(chunk);
|
|
838
|
+
scr_bytes_release(chunk);
|
|
839
|
+
if (scr_stdin_read_eof && !rest) scr_next_tick_raw(scr_stdio_finish_read);
|
|
840
|
+
return result;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
static ScrDyn *scr_stdio_method(ScrClosure *cb, ScrDyn *const *args, size_t argc) {
|
|
844
|
+
int method = (int)scr_box_get_f64(cb->caps[0]);
|
|
845
|
+
ScrDyn *self = scr_dyn_this_get();
|
|
846
|
+
if (self->kind != SCR_DYN_HANDLE || self->v.handle.tag != SCR_DYNH_STDIO) {
|
|
847
|
+
scr_dyn_release(self);
|
|
848
|
+
return scr_stdio_refusal("method receiver");
|
|
849
|
+
}
|
|
850
|
+
ScrStdio *stream = self->v.handle.ptr;
|
|
851
|
+
ScrDyn *arg = argc ? args[0] : scr_dyn_undefined();
|
|
852
|
+
ScrDyn *result = NULL;
|
|
853
|
+
if (method == STDIO_WRITE && stream->fd != 0) {
|
|
854
|
+
ScrDyn *encoding = argc > 1 ? args[1] : scr_dyn_undefined();
|
|
855
|
+
ScrDyn *callback = argc > 2 ? args[2] : scr_dyn_undefined();
|
|
856
|
+
if (encoding->kind == SCR_DYN_FUNC) { callback = encoding; encoding = scr_dyn_undefined(); }
|
|
857
|
+
if (callback->kind != SCR_DYN_UNDEF && callback->kind != SCR_DYN_NULL && callback->kind != SCR_DYN_FUNC) {
|
|
858
|
+
scr_dyn_arg_type_fail("cb", "of type function", callback);
|
|
859
|
+
goto done;
|
|
860
|
+
}
|
|
861
|
+
ScrBytes *bytes = NULL;
|
|
862
|
+
if (arg->kind == SCR_DYN_STR) {
|
|
863
|
+
if (encoding->kind != SCR_DYN_UNDEF && encoding->kind != SCR_DYN_NULL && encoding->kind != SCR_DYN_STR) {
|
|
864
|
+
result = scr_stdio_refusal("write encoding");
|
|
865
|
+
goto done;
|
|
866
|
+
}
|
|
867
|
+
ScrStr *enc = encoding->kind == SCR_DYN_STR ? scr_str_retain(encoding->v.str) : scr_str_new("utf8", 4);
|
|
868
|
+
bytes = scr_bytes_from_str(arg->v.str, enc);
|
|
869
|
+
scr_str_release(enc);
|
|
870
|
+
} else if (arg->kind == SCR_DYN_BYTES && arg->v.bytes->elem == SCR_BYTES_U8) {
|
|
871
|
+
bytes = scr_bytes_retain(arg->v.bytes);
|
|
872
|
+
} else {
|
|
873
|
+
scr_dyn_arg_type_fail("chunk", "of type string or an instance of Buffer, TypedArray, or DataView", arg);
|
|
874
|
+
goto done;
|
|
875
|
+
}
|
|
876
|
+
if (!bytes) goto done;
|
|
877
|
+
int error = scr_stdio_write_raw(stream->fd, bytes->data, bytes->len);
|
|
878
|
+
scr_bytes_release(bytes);
|
|
879
|
+
if (error) {
|
|
880
|
+
scr_stdio_queue_write_error(stream, callback, error);
|
|
881
|
+
result = scr_dyn_new_bool(false);
|
|
882
|
+
goto done;
|
|
883
|
+
}
|
|
884
|
+
if (callback->kind == SCR_DYN_FUNC) scr_next_tick(scr_stdio_callback(callback, (void *)scr_stdio_write_done));
|
|
885
|
+
result = scr_dyn_new_bool(true);
|
|
886
|
+
} else if (method == STDIO_ON || method == STDIO_ONCE || method == STDIO_OFF) {
|
|
887
|
+
ScrDyn *listener = argc > 1 ? args[1] : scr_dyn_undefined();
|
|
888
|
+
if (listener->kind != SCR_DYN_FUNC) {
|
|
889
|
+
scr_dyn_arg_type_fail("listener", "of type function", listener);
|
|
890
|
+
goto done;
|
|
891
|
+
}
|
|
892
|
+
const char *event = arg->kind == SCR_DYN_STR ? arg->v.str->data : "";
|
|
893
|
+
bool data = arg->kind == SCR_DYN_STR && arg->v.str->len == 4 && memcmp(event, "data", 4) == 0;
|
|
894
|
+
bool end = arg->kind == SCR_DYN_STR && arg->v.str->len == 3 && memcmp(event, "end", 3) == 0;
|
|
895
|
+
bool error = arg->kind == SCR_DYN_STR && arg->v.str->len == 5 && memcmp(event, "error", 5) == 0;
|
|
896
|
+
if ((!data && !end && !error) || (stream->fd != 0 && !error)) {
|
|
897
|
+
result = scr_stdio_refusal("event");
|
|
898
|
+
goto done;
|
|
899
|
+
}
|
|
900
|
+
bool remove = method == STDIO_OFF, once = method == STDIO_ONCE;
|
|
901
|
+
if (stream->fd == 0) {
|
|
902
|
+
if (!remove) {
|
|
903
|
+
if (data) scr_stdin_on_data(scr_stdio_callback(listener, (void *)scr_stdio_data), scr_stdio_data, once);
|
|
904
|
+
if (end) scr_stdin_on_end(scr_stdio_callback(listener, (void *)scr_stdio_end), once);
|
|
905
|
+
if (error) scr_stdin_on_error(scr_stdio_callback(listener, (void *)scr_stdio_error), scr_stdio_error, once);
|
|
906
|
+
} else {
|
|
907
|
+
#define REMOVE_STDIO_LISTENER(list, count, fire) \
|
|
908
|
+
for (size_t i = count; i > 0; i--) { \
|
|
909
|
+
if (scr_stdio_matches(list[i - 1].cb, (void *)fire, listener)) { \
|
|
910
|
+
scr_closure_release(list[i - 1].cb); \
|
|
911
|
+
memmove(list + i - 1, list + i, (count - i) * sizeof *list); \
|
|
912
|
+
count--; break; \
|
|
913
|
+
} \
|
|
914
|
+
}
|
|
915
|
+
if (data) { REMOVE_STDIO_LISTENER(scr_stdin_data, scr_stdin_ndata, scr_stdio_data); }
|
|
916
|
+
if (end) { REMOVE_STDIO_LISTENER(scr_stdin_end, scr_stdin_nend, scr_stdio_end); }
|
|
917
|
+
if (error) { REMOVE_STDIO_LISTENER(scr_stdin_err, scr_stdin_nerr, scr_stdio_error); }
|
|
918
|
+
#undef REMOVE_STDIO_LISTENER
|
|
919
|
+
}
|
|
920
|
+
} else if (remove) {
|
|
921
|
+
for (size_t i = stream->nerrors; i > 0; i--) {
|
|
922
|
+
if (scr_dyn_strict_eq(stream->errors[i - 1], listener)) {
|
|
923
|
+
scr_dyn_release(stream->errors[i - 1]);
|
|
924
|
+
memmove(stream->errors + i - 1, stream->errors + i, (stream->nerrors - i) * sizeof *stream->errors);
|
|
925
|
+
memmove(stream->error_once + i - 1, stream->error_once + i, (stream->nerrors - i) * sizeof *stream->error_once);
|
|
926
|
+
stream->nerrors--; break;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
} else {
|
|
930
|
+
stream->errors = realloc(stream->errors, (stream->nerrors + 1) * sizeof *stream->errors);
|
|
931
|
+
stream->error_once = realloc(stream->error_once, (stream->nerrors + 1) * sizeof *stream->error_once);
|
|
932
|
+
if (!stream->errors || !stream->error_once) scr_events_oom();
|
|
933
|
+
stream->errors[stream->nerrors] = scr_dyn_retain(listener);
|
|
934
|
+
stream->error_once[stream->nerrors++] = once;
|
|
935
|
+
}
|
|
936
|
+
result = scr_dyn_retain(self);
|
|
937
|
+
} else if (stream->fd == 0 && (method == STDIO_PAUSE || method == STDIO_RESUME)) {
|
|
938
|
+
scr_stdin_paused = method == STDIO_PAUSE;
|
|
939
|
+
scr_stdin_resumed = method == STDIO_RESUME;
|
|
940
|
+
result = scr_dyn_retain(self);
|
|
941
|
+
} else if (stream->fd == 0 && method == STDIO_IS_PAUSED) {
|
|
942
|
+
result = scr_dyn_new_bool(scr_stdin_paused);
|
|
943
|
+
} else if (stream->fd == 0 && method == STDIO_READ) {
|
|
944
|
+
result = scr_stdio_read(arg);
|
|
945
|
+
} else if (stream->fd == 0 && method == STDIO_RAW) {
|
|
946
|
+
scr_process_stdin_set_raw_mode(scr_dyn_truthy(arg));
|
|
947
|
+
if (!scr_exc_pending()) { scr_stdio_raw = scr_dyn_truthy(arg); result = scr_dyn_retain(self); }
|
|
948
|
+
} else if (stream->fd == 0 && method == STDIO_DESTROY && argc == 0) {
|
|
949
|
+
scr_stdin_destroy();
|
|
950
|
+
result = scr_dyn_retain(self);
|
|
951
|
+
} else result = scr_stdio_refusal(scr_stdio_names[method]);
|
|
952
|
+
done:
|
|
953
|
+
scr_dyn_release(self);
|
|
954
|
+
return result;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
static ScrDyn *scr_stdio_get(void *ptr, const char *key, size_t length) {
|
|
958
|
+
ScrStdio *stream = ptr;
|
|
959
|
+
if (length == 2 && memcmp(key, "fd", 2) == 0) return scr_dyn_new_num(stream->fd);
|
|
960
|
+
if (length == 5 && memcmp(key, "isTTY", 5) == 0)
|
|
961
|
+
return scr_process_is_tty(stream->fd) ? scr_dyn_new_bool(true) : scr_dyn_retain(scr_dyn_undefined());
|
|
962
|
+
if ((length == 7 && memcmp(key, "columns", 7) == 0) || (length == 4 && memcmp(key, "rows", 4) == 0)) {
|
|
963
|
+
double dimension = stream->fd == 0 ? -1 : length == 7 ? scr_process_columns(stream->fd) : scr_process_rows(stream->fd);
|
|
964
|
+
return dimension < 0 ? scr_dyn_retain(scr_dyn_undefined()) : scr_dyn_new_num(dimension);
|
|
965
|
+
}
|
|
966
|
+
if (stream->fd == 0 && length == 14 && memcmp(key, "readableLength", 14) == 0)
|
|
967
|
+
return scr_dyn_new_num(scr_stdin_buffer ? (double)scr_stdin_buffer->len : 0);
|
|
968
|
+
if (stream->fd == 0 && length == 5 && memcmp(key, "isRaw", 5) == 0)
|
|
969
|
+
return scr_process_is_tty(0) ? scr_dyn_new_bool(scr_stdio_raw) : scr_dyn_retain(scr_dyn_undefined());
|
|
970
|
+
if (stream->fd == 0 && length == 9 && memcmp(key, "destroyed", 9) == 0) return scr_dyn_new_bool(scr_stdin_destroyed);
|
|
971
|
+
if (length == 3 && memcmp(key, "off", 3) == 0) return scr_dyn_retain(scr_stdio_methods[STDIO_OFF]);
|
|
972
|
+
if (length == 11 && memcmp(key, "addListener", 11) == 0) return scr_dyn_retain(scr_stdio_methods[STDIO_ON]);
|
|
973
|
+
for (int i = 0; i < STDIO_METHOD_COUNT; i++) {
|
|
974
|
+
if (strlen(scr_stdio_names[i]) != length || memcmp(key, scr_stdio_names[i], length) != 0) continue;
|
|
975
|
+
if (i == STDIO_WRITE) return stream->fd == 0 ? NULL : scr_dyn_retain(stream->write ? stream->write : scr_stdio_methods[i]);
|
|
976
|
+
if (i == STDIO_RAW && !scr_process_is_tty(stream->fd)) return NULL;
|
|
977
|
+
if (i >= STDIO_PAUSE && stream->fd != 0) return scr_stdio_refusal(scr_stdio_names[i]);
|
|
978
|
+
return scr_dyn_retain(scr_stdio_methods[i]);
|
|
979
|
+
}
|
|
980
|
+
return NULL;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
static bool scr_stdio_set(void *ptr, const char *key, size_t length, const ScrDyn *value) {
|
|
984
|
+
ScrStdio *stream = ptr;
|
|
985
|
+
if (stream->fd == 0 || length != 5 || memcmp(key, "write", 5) != 0) return false;
|
|
986
|
+
ScrDyn *old = stream->write;
|
|
987
|
+
stream->write = scr_dyn_retain((ScrDyn *)value);
|
|
988
|
+
scr_dyn_release(old);
|
|
989
|
+
return true;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
static ScrDyn *scr_stdio_invoke(void *ptr, ScrDyn *self, const char *name,
|
|
993
|
+
ScrDyn *const *args, size_t argc, const char *what) {
|
|
994
|
+
ScrDyn *fn = scr_stdio_get(ptr, name, strlen(name));
|
|
995
|
+
if (scr_exc_pending()) return NULL;
|
|
996
|
+
scr_dyn_this_push_dyn(self);
|
|
997
|
+
ScrDyn *result = scr_dyn_call(fn ? fn : scr_dyn_undefined(), args, argc, what);
|
|
998
|
+
scr_dyn_this_pop();
|
|
999
|
+
scr_dyn_release(fn);
|
|
1000
|
+
return result;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
static bool scr_stdio_intercept(int fd, const void *data, size_t length) {
|
|
1004
|
+
ScrStdio *stream = &scr_stdio_streams[fd == 2 ? 2 : 1];
|
|
1005
|
+
if (!stream->write || scr_dyn_strict_eq(stream->write, scr_stdio_methods[STDIO_WRITE])) {
|
|
1006
|
+
(void)scr_stdio_write_raw(fd, data, length);
|
|
1007
|
+
return true;
|
|
1008
|
+
}
|
|
1009
|
+
ScrStr *text = scr_str_new(data, length);
|
|
1010
|
+
ScrDyn *chunk = scr_dyn_new_str(text);
|
|
1011
|
+
scr_str_release(text);
|
|
1012
|
+
scr_dyn_this_push(stream, SCR_DYNH_STDIO);
|
|
1013
|
+
ScrDyn *fn = scr_dyn_retain(stream->write);
|
|
1014
|
+
ScrDyn *result = scr_dyn_call(fn, &chunk, 1, "write");
|
|
1015
|
+
scr_dyn_release(fn);
|
|
1016
|
+
scr_dyn_this_pop();
|
|
1017
|
+
bool accepted = result && scr_dyn_truthy(result);
|
|
1018
|
+
scr_dyn_release(result);
|
|
1019
|
+
scr_dyn_release(chunk);
|
|
1020
|
+
return accepted;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
static void scr_stdio_cleanup(void) {
|
|
1024
|
+
scr_stdio_write_hook = NULL;
|
|
1025
|
+
for (int i = 0; i < 3; i++) {
|
|
1026
|
+
ScrStdio *stream = &scr_stdio_streams[i];
|
|
1027
|
+
scr_weak_dispose(stream);
|
|
1028
|
+
scr_dyn_release(stream->write);
|
|
1029
|
+
stream->write = NULL;
|
|
1030
|
+
scr_dyn_release(stream->write_error);
|
|
1031
|
+
stream->write_error = NULL;
|
|
1032
|
+
for (size_t j = 0; j < stream->nerrors; j++) scr_dyn_release(stream->errors[j]);
|
|
1033
|
+
free(stream->errors); free(stream->error_once);
|
|
1034
|
+
stream->errors = NULL; stream->error_once = NULL; stream->nerrors = 0;
|
|
1035
|
+
}
|
|
1036
|
+
for (int i = 0; i < STDIO_METHOD_COUNT; i++) {
|
|
1037
|
+
scr_dyn_release(scr_stdio_methods[i]);
|
|
1038
|
+
scr_stdio_methods[i] = NULL;
|
|
1039
|
+
}
|
|
1040
|
+
scr_stdio_initialized = false;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
static void *scr_stdio_retain(void *ptr) { return ptr; }
|
|
1044
|
+
static void scr_stdio_release(void *ptr) { (void)ptr; }
|
|
1045
|
+
|
|
1046
|
+
ScrDyn *scr_process_stdio(double fd) {
|
|
1047
|
+
if (!scr_stdio_initialized) {
|
|
1048
|
+
scr_stdio_initialized = true;
|
|
1049
|
+
static const ScrDynHandleOps ops = {
|
|
1050
|
+
.cls = "ProcessStream", .retain = scr_stdio_retain, .release = scr_stdio_release,
|
|
1051
|
+
.get = scr_stdio_get, .set = scr_stdio_set, .invoke = scr_stdio_invoke,
|
|
1052
|
+
};
|
|
1053
|
+
scr_dyn_handle_install(SCR_DYNH_STDIO, &ops);
|
|
1054
|
+
for (int i = 0; i < STDIO_METHOD_COUNT; i++) {
|
|
1055
|
+
ScrClosure *cb = scr_closure_new(NULL, 1);
|
|
1056
|
+
cb->caps[0] = scr_box_new(SCR_BOX_F64);
|
|
1057
|
+
scr_box_set_f64(cb->caps[0], i);
|
|
1058
|
+
scr_stdio_methods[i] = scr_dyn_new_func(cb, scr_stdio_method, i == STDIO_WRITE ? 3 : 1, "", scr_stdio_names[i]);
|
|
1059
|
+
}
|
|
1060
|
+
scr_stdio_write_hook = scr_stdio_intercept;
|
|
1061
|
+
}
|
|
1062
|
+
return scr_dyn_new_handle(&scr_stdio_streams[fd == 0 ? 0 : fd == 2 ? 2 : 1], SCR_DYNH_STDIO);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/* ── the process 'exit' event ─────────────────────────────────────────
|
|
1066
|
+
* Listeners run SYNCHRONOUSLY when the process exits: at the end of a
|
|
1067
|
+
* normal run (the unit's atexit, registered by scr_events_install after
|
|
1068
|
+
* scr_init's hooks, so it runs BEFORE the RC audit/flush by LIFO) and
|
|
1069
|
+
* inside process.exit() (scr_lib.c calls through scr_process_exit_hook
|
|
1070
|
+
* before its deliberate _Exit — Node runs 'exit' listeners on explicit
|
|
1071
|
+
* exits too). The code argument: process.exit's real code on that path;
|
|
1072
|
+
* on the atexit path the hint kept in scr_async.c — 0 unless the
|
|
1073
|
+
* uncaught-exception or unhandled-rejection reporters marked the run as
|
|
1074
|
+
* failing (they set 1 exactly when main returns 1). Signal deaths skip
|
|
1075
|
+
* Node's 'exit' event alike. `once` and `off` follow the signal
|
|
1076
|
+
* registry's rules; anything a listener schedules can never run (the
|
|
1077
|
+
* loop is gone), exactly Node's contract. */
|
|
1078
|
+
|
|
1079
|
+
typedef struct {
|
|
1080
|
+
ScrClosure *cb; /* owned */
|
|
1081
|
+
void (*fn)(ScrClosure *cb, double code); /* adapter: 0-param or (code) */
|
|
1082
|
+
bool once;
|
|
1083
|
+
} ScrExitListener;
|
|
1084
|
+
|
|
1085
|
+
static ScrExitListener *scr_exit_ls = NULL;
|
|
1086
|
+
static size_t scr_exit_n = 0, scr_exit_cap = 0;
|
|
1087
|
+
static bool scr_exit_ran = false;
|
|
1088
|
+
|
|
1089
|
+
void scr_run_exit_listeners(double code) {
|
|
1090
|
+
if (scr_exit_ran) return; /* process.exit inside a listener: no recursion */
|
|
1091
|
+
scr_exit_ran = true;
|
|
1092
|
+
scr_process_in_exit = true; /* process._exiting — Node's flag */
|
|
1093
|
+
for (size_t i = 0; i < scr_exit_n; i++) {
|
|
1094
|
+
scr_exit_ls[i].fn(scr_exit_ls[i].cb, code);
|
|
1095
|
+
if (scr_exc_pending()) {
|
|
1096
|
+
/* Node: a throw in an 'exit' listener is fatal (exit code 7). */
|
|
1097
|
+
scr_exc_print_uncaught();
|
|
1098
|
+
fflush(stdout);
|
|
1099
|
+
_Exit(7);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
for (size_t i = 0; i < scr_exit_n; i++) scr_closure_release(scr_exit_ls[i].cb);
|
|
1103
|
+
free(scr_exit_ls);
|
|
1104
|
+
scr_exit_ls = NULL;
|
|
1105
|
+
scr_exit_n = scr_exit_cap = 0;
|
|
1106
|
+
/* Ticks the listeners enqueued never run (Node drops the queue at
|
|
1107
|
+
* exit) — release them here or the RC audit counts them as leaks (the
|
|
1108
|
+
* loop's own teardown already ran, before these listeners). */
|
|
1109
|
+
scr_nticks_teardown();
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
void scr_process_on_exit(ScrClosure *cb /*moves*/, void (*fn)(ScrClosure *, double),
|
|
1113
|
+
bool once) {
|
|
1114
|
+
if (scr_exit_ran) {
|
|
1115
|
+
scr_closure_release(cb);
|
|
1116
|
+
return;
|
|
1117
|
+
}
|
|
1118
|
+
if (scr_exit_n == scr_exit_cap) {
|
|
1119
|
+
scr_exit_cap = scr_exit_cap ? scr_exit_cap * 2 : 2;
|
|
1120
|
+
scr_exit_ls = realloc(scr_exit_ls, scr_exit_cap * sizeof *scr_exit_ls);
|
|
1121
|
+
if (!scr_exit_ls) scr_events_oom();
|
|
1122
|
+
}
|
|
1123
|
+
scr_exit_ls[scr_exit_n].cb = cb;
|
|
1124
|
+
scr_exit_ls[scr_exit_n].fn = fn;
|
|
1125
|
+
scr_exit_ls[scr_exit_n].once = once;
|
|
1126
|
+
scr_exit_n++;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
void scr_process_off_exit(ScrClosure *cb /*borrowed*/) {
|
|
1130
|
+
for (size_t i = 0; i < scr_exit_n; i++) {
|
|
1131
|
+
if (scr_exit_ls[i].cb == cb) {
|
|
1132
|
+
scr_closure_release(scr_exit_ls[i].cb);
|
|
1133
|
+
memmove(scr_exit_ls + i, scr_exit_ls + i + 1, (scr_exit_n - i - 1) * sizeof *scr_exit_ls);
|
|
1134
|
+
scr_exit_n--;
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/* The runtime-provided exit listener adapters (the code is a plain
|
|
1141
|
+
* double — no program types needed). */
|
|
1142
|
+
void scr_exit_thunk0(ScrClosure *cb, double code) {
|
|
1143
|
+
(void)code;
|
|
1144
|
+
((void (*)(ScrClosure *))cb->fn)(cb);
|
|
1145
|
+
}
|
|
1146
|
+
void scr_exit_thunk_code(ScrClosure *cb, double code) {
|
|
1147
|
+
((void (*)(ScrClosure *, double))cb->fn)(cb, code);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/* The runtime-provided stdin data adapters. */
|
|
1151
|
+
void scr_stdin_data_thunk0(ScrClosure *cb, ScrBytes *chunk) {
|
|
1152
|
+
(void)chunk;
|
|
1153
|
+
((void (*)(ScrClosure *))cb->fn)(cb);
|
|
1154
|
+
}
|
|
1155
|
+
void scr_stdin_data_thunk_bytes(ScrClosure *cb, ScrBytes *chunk) {
|
|
1156
|
+
/* The listener owns its +1 param per the universal convention. */
|
|
1157
|
+
((void (*)(ScrClosure *, ScrBytes *))cb->fn)(cb, scr_bytes_retain(chunk));
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
/* ── the loop hooks (see scr_async.c) ─────────────────────────────────── */
|
|
1162
|
+
|
|
1163
|
+
static bool scr_events_pending(void) { return scr_stdin_pending(); }
|
|
1164
|
+
|
|
1165
|
+
static bool scr_events_watching(void) {
|
|
1166
|
+
return scr_sig_watched > 0 || scr_stdin_pending();
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/* One dispatch pass at a loop turn: wake-pipe bytes are consumed (safe
|
|
1170
|
+
* any time), flagged signals fire, and stdin is probed/served. */
|
|
1171
|
+
static void scr_events_dispatch(void) {
|
|
1172
|
+
scr_wake_pipe_drain();
|
|
1173
|
+
scr_signals_drain();
|
|
1174
|
+
if (scr_exc_pending()) return;
|
|
1175
|
+
scr_stdin_service();
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/* Fds the loop's idle poll(2) should watch (POLLIN): the wake pipe while
|
|
1179
|
+
* any signal is watched, fd 0 while stdin has a consumer. */
|
|
1180
|
+
static int scr_events_pollfds(int out[2]) {
|
|
1181
|
+
int n = 0;
|
|
1182
|
+
if (scr_sig_watched > 0 && scr_wake_pipe[0] >= 0) out[n++] = scr_wake_pipe[0];
|
|
1183
|
+
if (scr_stdin_pending()) out[n++] = 0;
|
|
1184
|
+
return n;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/* The atexit half of the 'exit' event: normal termination reports the
|
|
1188
|
+
* abnormal-exit hint (0 unless the uncaught/unhandled reporters noted 1 —
|
|
1189
|
+
* exactly when main returns 1). */
|
|
1190
|
+
static void scr_exit_atexit(void) { scr_run_exit_listeners((double)scr_exit_code_hint_get()); }
|
|
1191
|
+
|
|
1192
|
+
/* Exit-time registry cleanup: listeners a program leaves registered at
|
|
1193
|
+
* exit are Node-legitimate, not leaks — signal handlers for the process's
|
|
1194
|
+
* whole life, and stdin listeners for events that never came (the
|
|
1195
|
+
* data-wins-the-race shape leaves its once-'end'/'error' listeners
|
|
1196
|
+
* parked). Registered BEFORE the exit-event atexit, so by LIFO the 'exit'
|
|
1197
|
+
* listeners fire first, then everything releases, then the RC audit sees
|
|
1198
|
+
* a clean heap. */
|
|
1199
|
+
static void scr_events_cleanup_atexit(void) {
|
|
1200
|
+
scr_sig_cleanup();
|
|
1201
|
+
scr_stdin_settle_done();
|
|
1202
|
+
scr_stdin_drop_listeners();
|
|
1203
|
+
scr_bytes_release(scr_stdin_buffer);
|
|
1204
|
+
scr_stdin_buffer = NULL;
|
|
1205
|
+
if (scr_stdio_initialized) scr_stdio_cleanup();
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
void scr_events_install(void) {
|
|
1209
|
+
static bool installed = false;
|
|
1210
|
+
if (installed) return;
|
|
1211
|
+
installed = true;
|
|
1212
|
+
#ifdef __wasi__
|
|
1213
|
+
int stdin_flags = fcntl(0, F_GETFL, 0);
|
|
1214
|
+
if (stdin_flags >= 0) (void)fcntl(0, F_SETFL, stdin_flags | O_NONBLOCK);
|
|
1215
|
+
#endif
|
|
1216
|
+
atexit(scr_events_cleanup_atexit);
|
|
1217
|
+
atexit(scr_exit_atexit);
|
|
1218
|
+
scr_loop_set_events(&scr_events_pending, &scr_events_watching, &scr_events_dispatch,
|
|
1219
|
+
&scr_events_pollfds);
|
|
1220
|
+
scr_process_exit_hook = &scr_run_exit_listeners;
|
|
1221
|
+
scr_stdin_destroy_hook = &scr_stdin_destroy;
|
|
1222
|
+
}
|