@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,1444 @@
|
|
|
1
|
+
#include "scr_runtime.h"
|
|
2
|
+
|
|
3
|
+
#include <math.h>
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
#include <stdlib.h>
|
|
6
|
+
#include <string.h>
|
|
7
|
+
|
|
8
|
+
#define SCR_ARR_MAX_LENGTH ((size_t)UINT32_MAX)
|
|
9
|
+
#define SCR_ARR_MAX_INDEX (SCR_ARR_MAX_LENGTH - 1)
|
|
10
|
+
/* Keep the packed representation bounded. Requests below this cutoff grow
|
|
11
|
+
* geometrically in dense storage; indices at or above it use sorted sparse
|
|
12
|
+
* entries. Sequential appends after crossing the cutoff intentionally trade
|
|
13
|
+
* memory for side-store insertion work. */
|
|
14
|
+
#define SCR_ARR_DENSE_LIMIT ((size_t)1 << 20)
|
|
15
|
+
|
|
16
|
+
/* Live heap-array count for the RC audit lane (-DSCR_RC_AUDIT); same
|
|
17
|
+
* contract as scr_str_live_count in scr_string.c. */
|
|
18
|
+
#ifdef SCR_RC_AUDIT
|
|
19
|
+
static SCR_TL long scr_live_arrays = 0;
|
|
20
|
+
long scr_arr_live_count(void) { return scr_live_arrays; }
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
static void scr_arr_oom(void) {
|
|
24
|
+
scr_trap("scriptc: out of memory\n");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Canonical array indices grow indexed storage and may leave holes. Negative,
|
|
28
|
+
* fractional, NaN, infinity, and 2^32-1 numeric keys use the ordinary
|
|
29
|
+
* property vector; only a missing property or a low-level read of a hole
|
|
30
|
+
* reaches the proven-accessor trap. */
|
|
31
|
+
static void scr_arr_trap_oob(double i, size_t len) {
|
|
32
|
+
char buf[32];
|
|
33
|
+
scr_f64_to_str(i, buf);
|
|
34
|
+
scr_trap_fmt("scriptc: RangeError: array index %s out of bounds (length %zu)\n",
|
|
35
|
+
buf, len);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Validate i as a canonical JavaScript array index after the caller has
|
|
39
|
+
* dispatched noncanonical numeric keys to ordinary property storage. */
|
|
40
|
+
static size_t scr_arr_check_index(const ScrArr *a, double i, bool allow_append) {
|
|
41
|
+
const double max_index = (double)SCR_ARR_MAX_INDEX;
|
|
42
|
+
if (!(i >= 0) || i != trunc(i) || i > max_index ||
|
|
43
|
+
(!allow_append && i >= (double)a->len)) {
|
|
44
|
+
scr_arr_trap_oob(i, a->len);
|
|
45
|
+
}
|
|
46
|
+
return (size_t)i;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static bool scr_arr_valid_index(double i, size_t *out) {
|
|
50
|
+
if (!(i >= 0) || i != trunc(i) || i > (double)SCR_ARR_MAX_INDEX) return false;
|
|
51
|
+
*out = (size_t)i;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static size_t scr_arr_prop_index(const ScrArr *a, const char *key,
|
|
56
|
+
size_t key_len) {
|
|
57
|
+
for (size_t i = 0; i < a->prop_len; i++) {
|
|
58
|
+
if (a->props[i].key_len == key_len &&
|
|
59
|
+
memcmp(a->props[i].key, key, key_len) == 0) {
|
|
60
|
+
return i;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return SIZE_MAX;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static size_t scr_arr_prop_key(double i, char *buf) {
|
|
67
|
+
return scr_f64_to_str(i, buf);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static void scr_arr_grow_props(ScrArr *a, size_t need) {
|
|
71
|
+
if (need <= a->prop_cap) return;
|
|
72
|
+
size_t cap = a->prop_cap ? a->prop_cap : 4;
|
|
73
|
+
while (cap < need) {
|
|
74
|
+
if (cap > SIZE_MAX / 2 / sizeof(*a->props)) scr_arr_oom();
|
|
75
|
+
cap *= 2;
|
|
76
|
+
}
|
|
77
|
+
ScrArrProp *props = realloc(a->props, cap * sizeof(*props));
|
|
78
|
+
if (!props) scr_arr_oom();
|
|
79
|
+
a->props = props;
|
|
80
|
+
a->prop_cap = cap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ── slot packing: 8-byte slots hold doubles, bools, or pointers ───────── */
|
|
84
|
+
|
|
85
|
+
static uint64_t scr_slot_from_f64(double v) {
|
|
86
|
+
uint64_t s;
|
|
87
|
+
memcpy(&s, &v, sizeof s);
|
|
88
|
+
return s;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static double scr_slot_to_f64(uint64_t s) {
|
|
92
|
+
double v;
|
|
93
|
+
memcpy(&v, &s, sizeof v);
|
|
94
|
+
return v;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static uint64_t scr_slot_from_ptr(void *p) { return (uint64_t)(uintptr_t)p; }
|
|
98
|
+
|
|
99
|
+
static void *scr_slot_to_ptr(uint64_t s) { return (void *)(uintptr_t)s; }
|
|
100
|
+
|
|
101
|
+
static bool scr_elem_is_ref(ScrElemKind k) {
|
|
102
|
+
return k == SCR_ELEM_STR || k == SCR_ELEM_ARR || k == SCR_ELEM_BYTES ||
|
|
103
|
+
k == SCR_ELEM_REF;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static void scr_elem_release(const ScrArr *a, uint64_t slot) {
|
|
107
|
+
void *p = scr_slot_to_ptr(slot);
|
|
108
|
+
if (!p) return;
|
|
109
|
+
if (a->elem == SCR_ELEM_STR) scr_str_release((ScrStr *)p);
|
|
110
|
+
else if (a->elem == SCR_ELEM_ARR) scr_arr_release((ScrArr *)p);
|
|
111
|
+
else if (a->elem == SCR_ELEM_BYTES) scr_bytes_release((ScrBytes *)p);
|
|
112
|
+
else if (a->elem == SCR_ELEM_REF) a->elem_release(p);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static uint64_t scr_elem_retain_slot(const ScrArr *a, uint64_t slot) {
|
|
116
|
+
if (!scr_elem_is_ref(a->elem)) return slot;
|
|
117
|
+
void *p = scr_slot_to_ptr(slot);
|
|
118
|
+
if (!p) return slot;
|
|
119
|
+
if (a->elem == SCR_ELEM_STR) p = scr_str_retain((ScrStr *)p);
|
|
120
|
+
else if (a->elem == SCR_ELEM_ARR) p = scr_arr_retain((ScrArr *)p);
|
|
121
|
+
else if (a->elem == SCR_ELEM_BYTES) p = scr_bytes_retain((ScrBytes *)p);
|
|
122
|
+
else p = a->elem_retain(p);
|
|
123
|
+
return scr_slot_from_ptr(p);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
static uint64_t scr_arr_retain_state_slot(const ScrArr *a, uint64_t slot,
|
|
127
|
+
uint8_t state) {
|
|
128
|
+
return state == SCR_ARR_VALUE ? scr_elem_retain_slot(a, slot) : 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ── storage and lifecycle ─────────────────────────────────────────────── */
|
|
132
|
+
|
|
133
|
+
typedef struct {
|
|
134
|
+
uint64_t *data;
|
|
135
|
+
uint8_t *present;
|
|
136
|
+
size_t cap;
|
|
137
|
+
ScrArrSparseSlot *sparse;
|
|
138
|
+
size_t sparse_len;
|
|
139
|
+
size_t sparse_cap;
|
|
140
|
+
} ScrArrStorage;
|
|
141
|
+
|
|
142
|
+
static void scr_arr_grow_dense(ScrArr *a, size_t need) {
|
|
143
|
+
if (need <= a->cap || need > SCR_ARR_DENSE_LIMIT) return;
|
|
144
|
+
size_t cap = a->cap ? a->cap : 4;
|
|
145
|
+
while (cap < need && cap < SCR_ARR_DENSE_LIMIT) {
|
|
146
|
+
if (cap > SIZE_MAX / 2 / sizeof(uint64_t)) scr_arr_oom();
|
|
147
|
+
cap *= 2;
|
|
148
|
+
}
|
|
149
|
+
if (cap > SCR_ARR_DENSE_LIMIT) cap = SCR_ARR_DENSE_LIMIT;
|
|
150
|
+
uint64_t *data = realloc(a->data, cap * sizeof(uint64_t));
|
|
151
|
+
if (!data) scr_arr_oom();
|
|
152
|
+
uint8_t *present = realloc(a->present, cap);
|
|
153
|
+
if (!present) scr_arr_oom();
|
|
154
|
+
memset(present + a->cap, 0, cap - a->cap);
|
|
155
|
+
a->data = data;
|
|
156
|
+
a->present = present;
|
|
157
|
+
a->cap = cap;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static void scr_arr_grow_for_index(ScrArr *a, size_t index) {
|
|
161
|
+
if (index < SCR_ARR_DENSE_LIMIT) scr_arr_grow_dense(a, index + 1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static size_t scr_arr_sparse_lower_bound(const ScrArrSparseSlot *slots,
|
|
165
|
+
size_t n, size_t index) {
|
|
166
|
+
size_t lo = 0, hi = n;
|
|
167
|
+
while (lo < hi) {
|
|
168
|
+
size_t mid = lo + (hi - lo) / 2;
|
|
169
|
+
if (slots[mid].index < index) lo = mid + 1;
|
|
170
|
+
else hi = mid;
|
|
171
|
+
}
|
|
172
|
+
return lo;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
static uint8_t scr_arr_state_at_storage(const ScrArrStorage *s, size_t index,
|
|
176
|
+
uint64_t *out) {
|
|
177
|
+
if (index < s->cap) {
|
|
178
|
+
if (s->present[index] == SCR_ARR_HOLE) return SCR_ARR_HOLE;
|
|
179
|
+
if (out) *out = s->data[index];
|
|
180
|
+
return s->present[index];
|
|
181
|
+
}
|
|
182
|
+
size_t pos = scr_arr_sparse_lower_bound(s->sparse, s->sparse_len, index);
|
|
183
|
+
if (pos == s->sparse_len || s->sparse[pos].index != index) return SCR_ARR_HOLE;
|
|
184
|
+
if (out) *out = s->sparse[pos].slot;
|
|
185
|
+
return s->sparse[pos].state;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static bool scr_arr_slot_at_storage(const ScrArrStorage *s, size_t index,
|
|
189
|
+
uint64_t *out) {
|
|
190
|
+
return scr_arr_state_at_storage(s, index, out) != SCR_ARR_HOLE;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
static bool scr_arr_slot_at(const ScrArr *a, size_t index, uint64_t *out) {
|
|
194
|
+
ScrArrStorage s = {
|
|
195
|
+
a->data, a->present, a->cap, a->sparse, a->sparse_len, a->sparse_cap};
|
|
196
|
+
return scr_arr_slot_at_storage(&s, index, out);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static uint8_t scr_arr_state_at(const ScrArr *a, size_t index, uint64_t *out) {
|
|
200
|
+
ScrArrStorage s = {
|
|
201
|
+
a->data, a->present, a->cap, a->sparse, a->sparse_len, a->sparse_cap};
|
|
202
|
+
return scr_arr_state_at_storage(&s, index, out);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
static void scr_arr_grow_sparse(ScrArr *a, size_t need) {
|
|
206
|
+
if (need <= a->sparse_cap) return;
|
|
207
|
+
size_t cap = a->sparse_cap ? a->sparse_cap : 4;
|
|
208
|
+
while (cap < need) {
|
|
209
|
+
if (cap > SIZE_MAX / 2 / sizeof(*a->sparse)) scr_arr_oom();
|
|
210
|
+
cap *= 2;
|
|
211
|
+
}
|
|
212
|
+
ScrArrSparseSlot *slots = realloc(a->sparse, cap * sizeof(*slots));
|
|
213
|
+
if (!slots) scr_arr_oom();
|
|
214
|
+
a->sparse = slots;
|
|
215
|
+
a->sparse_cap = cap;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* Store an owned slot into an empty index. The caller has already established
|
|
219
|
+
* the destination length and does not need a retain. */
|
|
220
|
+
static void scr_arr_store_owned(ScrArr *a, size_t index, uint64_t slot) {
|
|
221
|
+
scr_arr_grow_for_index(a, index);
|
|
222
|
+
if (index < a->cap) {
|
|
223
|
+
a->data[index] = slot;
|
|
224
|
+
a->present[index] = SCR_ARR_VALUE;
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
size_t pos = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, index);
|
|
228
|
+
if (pos < a->sparse_len && a->sparse[pos].index == index) {
|
|
229
|
+
a->sparse[pos].slot = slot;
|
|
230
|
+
a->sparse[pos].state = SCR_ARR_VALUE;
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
scr_arr_grow_sparse(a, a->sparse_len + 1);
|
|
234
|
+
memmove(a->sparse + pos + 1, a->sparse + pos,
|
|
235
|
+
(a->sparse_len - pos) * sizeof(*a->sparse));
|
|
236
|
+
a->sparse[pos] = (ScrArrSparseSlot){index, slot, SCR_ARR_VALUE};
|
|
237
|
+
a->sparse_len++;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
static void scr_arr_store_state_owned(ScrArr *a, size_t index, uint64_t slot,
|
|
241
|
+
uint8_t state) {
|
|
242
|
+
scr_arr_grow_for_index(a, index);
|
|
243
|
+
if (index < a->cap) {
|
|
244
|
+
a->data[index] = slot;
|
|
245
|
+
a->present[index] = state;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
size_t pos = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, index);
|
|
249
|
+
if (pos < a->sparse_len && a->sparse[pos].index == index) {
|
|
250
|
+
a->sparse[pos].slot = slot;
|
|
251
|
+
a->sparse[pos].state = state;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
scr_arr_grow_sparse(a, a->sparse_len + 1);
|
|
255
|
+
memmove(a->sparse + pos + 1, a->sparse + pos,
|
|
256
|
+
(a->sparse_len - pos) * sizeof(*a->sparse));
|
|
257
|
+
a->sparse[pos] = (ScrArrSparseSlot){index, slot, state};
|
|
258
|
+
a->sparse_len++;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static bool scr_arr_take_state(ScrArr *a, size_t index, uint64_t *out,
|
|
262
|
+
uint8_t *state_out) {
|
|
263
|
+
if (index < a->cap) {
|
|
264
|
+
uint8_t state = a->present[index];
|
|
265
|
+
if (state == SCR_ARR_HOLE) return false;
|
|
266
|
+
*out = a->data[index];
|
|
267
|
+
a->present[index] = SCR_ARR_HOLE;
|
|
268
|
+
a->data[index] = 0;
|
|
269
|
+
if (state_out) *state_out = state;
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
size_t pos = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, index);
|
|
273
|
+
if (pos == a->sparse_len || a->sparse[pos].index != index) return false;
|
|
274
|
+
*out = a->sparse[pos].slot;
|
|
275
|
+
if (state_out) *state_out = a->sparse[pos].state;
|
|
276
|
+
memmove(a->sparse + pos, a->sparse + pos + 1,
|
|
277
|
+
(a->sparse_len - pos - 1) * sizeof(*a->sparse));
|
|
278
|
+
a->sparse_len--;
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
static void scr_arr_replace_owned(ScrArr *a, size_t index, uint64_t slot) {
|
|
283
|
+
if (index < a->cap) {
|
|
284
|
+
uint8_t state = a->present[index];
|
|
285
|
+
uint64_t old = state == SCR_ARR_VALUE ? a->data[index] : 0;
|
|
286
|
+
/* Publish the new edge before releasing the old one: a release can
|
|
287
|
+
* collect cycles. Holes have uninitialized data and must not be read. */
|
|
288
|
+
a->data[index] = slot;
|
|
289
|
+
a->present[index] = SCR_ARR_VALUE;
|
|
290
|
+
if (state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) scr_elem_release(a, old);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
uint64_t old;
|
|
294
|
+
uint8_t state;
|
|
295
|
+
bool had = scr_arr_take_state(a, index, &old, &state);
|
|
296
|
+
scr_arr_store_owned(a, index, slot);
|
|
297
|
+
if (had && state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) scr_elem_release(a, old);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
static void scr_arr_replace_state_owned(ScrArr *a, size_t index, uint64_t slot,
|
|
301
|
+
uint8_t state) {
|
|
302
|
+
uint64_t old;
|
|
303
|
+
uint8_t old_state;
|
|
304
|
+
bool had = scr_arr_take_state(a, index, &old, &old_state);
|
|
305
|
+
scr_arr_store_state_owned(a, index, slot, state);
|
|
306
|
+
if (had && old_state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) {
|
|
307
|
+
scr_elem_release(a, old);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
static bool scr_arr_prop_get_state(const ScrArr *a, double key, uint64_t *out,
|
|
312
|
+
uint8_t *state_out) {
|
|
313
|
+
char text[64];
|
|
314
|
+
size_t len = scr_arr_prop_key(key, text);
|
|
315
|
+
size_t pos = scr_arr_prop_index(a, text, len);
|
|
316
|
+
if (pos == SIZE_MAX) return false;
|
|
317
|
+
if (out) *out = a->props[pos].slot;
|
|
318
|
+
if (state_out) *state_out = a->props[pos].state;
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
static bool scr_arr_prop_get(const ScrArr *a, double key, uint64_t *out) {
|
|
323
|
+
return scr_arr_prop_get_state(a, key, out, NULL);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
static void scr_arr_prop_set(ScrArr *a, double key, uint64_t slot) {
|
|
327
|
+
char text[64];
|
|
328
|
+
size_t len = scr_arr_prop_key(key, text);
|
|
329
|
+
size_t pos = scr_arr_prop_index(a, text, len);
|
|
330
|
+
if (pos != SIZE_MAX) {
|
|
331
|
+
uint64_t old = a->props[pos].slot;
|
|
332
|
+
a->props[pos].slot = slot;
|
|
333
|
+
uint8_t old_state = a->props[pos].state;
|
|
334
|
+
a->props[pos].state = SCR_ARR_VALUE;
|
|
335
|
+
if (old_state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) {
|
|
336
|
+
scr_elem_release(a, old);
|
|
337
|
+
}
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
scr_arr_grow_props(a, a->prop_len + 1);
|
|
341
|
+
char *copy = malloc(len + 1);
|
|
342
|
+
if (!copy) scr_arr_oom();
|
|
343
|
+
memcpy(copy, text, len + 1);
|
|
344
|
+
a->props[a->prop_len++] = (ScrArrProp){copy, len, slot, SCR_ARR_VALUE};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
static void scr_arr_prop_set_undefined(ScrArr *a, double key) {
|
|
348
|
+
char text[64];
|
|
349
|
+
size_t len = scr_arr_prop_key(key, text);
|
|
350
|
+
size_t pos = scr_arr_prop_index(a, text, len);
|
|
351
|
+
if (pos != SIZE_MAX) {
|
|
352
|
+
uint64_t old = a->props[pos].slot;
|
|
353
|
+
uint8_t old_state = a->props[pos].state;
|
|
354
|
+
a->props[pos].slot = 0;
|
|
355
|
+
a->props[pos].state = SCR_ARR_UNDEFINED;
|
|
356
|
+
if (old_state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) {
|
|
357
|
+
scr_elem_release(a, old);
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
scr_arr_grow_props(a, a->prop_len + 1);
|
|
362
|
+
char *copy = malloc(len + 1);
|
|
363
|
+
if (!copy) scr_arr_oom();
|
|
364
|
+
memcpy(copy, text, len + 1);
|
|
365
|
+
a->props[a->prop_len++] = (ScrArrProp){copy, len, 0, SCR_ARR_UNDEFINED};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static bool scr_arr_prop_delete(ScrArr *a, double key) {
|
|
369
|
+
char text[64];
|
|
370
|
+
size_t len = scr_arr_prop_key(key, text);
|
|
371
|
+
size_t pos = scr_arr_prop_index(a, text, len);
|
|
372
|
+
if (pos == SIZE_MAX) return false;
|
|
373
|
+
uint64_t old = a->props[pos].slot;
|
|
374
|
+
uint8_t old_state = a->props[pos].state;
|
|
375
|
+
free(a->props[pos].key);
|
|
376
|
+
memmove(a->props + pos, a->props + pos + 1,
|
|
377
|
+
(a->prop_len - pos - 1) * sizeof(*a->props));
|
|
378
|
+
a->prop_len--;
|
|
379
|
+
if (old_state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) {
|
|
380
|
+
scr_elem_release(a, old);
|
|
381
|
+
}
|
|
382
|
+
return true;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
static ScrArrStorage scr_arr_take_storage(ScrArr *a) {
|
|
386
|
+
ScrArrStorage old = {
|
|
387
|
+
a->data, a->present, a->cap, a->sparse, a->sparse_len,
|
|
388
|
+
a->sparse_cap};
|
|
389
|
+
a->data = NULL;
|
|
390
|
+
a->present = NULL;
|
|
391
|
+
a->cap = 0;
|
|
392
|
+
a->sparse = NULL;
|
|
393
|
+
a->sparse_len = 0;
|
|
394
|
+
a->sparse_cap = 0;
|
|
395
|
+
return old;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
static void scr_arr_free_storage(ScrArrStorage *s) {
|
|
399
|
+
free(s->data);
|
|
400
|
+
free(s->present);
|
|
401
|
+
free(s->sparse);
|
|
402
|
+
memset(s, 0, sizeof(*s));
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
ScrArr *scr_arr_new(ScrElemKind elem, size_t initial_cap) {
|
|
406
|
+
ScrArr *a = malloc(sizeof(ScrArr));
|
|
407
|
+
if (!a) scr_arr_oom();
|
|
408
|
+
a->rc = 1;
|
|
409
|
+
a->len = 0;
|
|
410
|
+
a->cap = 0;
|
|
411
|
+
a->elem = elem;
|
|
412
|
+
a->elem_retain = NULL;
|
|
413
|
+
a->elem_release = NULL;
|
|
414
|
+
a->elem_trace = NULL;
|
|
415
|
+
a->data = NULL;
|
|
416
|
+
a->present = NULL;
|
|
417
|
+
a->sparse = NULL;
|
|
418
|
+
a->sparse_len = 0;
|
|
419
|
+
a->sparse_cap = 0;
|
|
420
|
+
a->props = NULL;
|
|
421
|
+
a->prop_len = 0;
|
|
422
|
+
a->prop_cap = 0;
|
|
423
|
+
if (initial_cap > 0) scr_arr_grow_dense(a, initial_cap);
|
|
424
|
+
#ifdef SCR_RC_AUDIT
|
|
425
|
+
scr_live_arrays++;
|
|
426
|
+
#endif
|
|
427
|
+
return a;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/* Collector trace of a cycle-capable array: every element is a headered
|
|
431
|
+
* child (elem_trace non-NULL means the element TYPE carries a header, and
|
|
432
|
+
* arrays are monomorphic), so trace visits all of them and the teardown
|
|
433
|
+
* below releases none — the complement contract in scr_runtime.h. */
|
|
434
|
+
void scr_arr_trace_v(void *a0, ScrTraceVisit visit, void *ctx) {
|
|
435
|
+
ScrArr *a = (ScrArr *)a0;
|
|
436
|
+
for (size_t i = 0; i < a->cap; i++) {
|
|
437
|
+
if (a->present[i] == SCR_ARR_VALUE) visit(scr_slot_to_ptr(a->data[i]), ctx);
|
|
438
|
+
}
|
|
439
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
440
|
+
if (a->sparse[i].state == SCR_ARR_VALUE) {
|
|
441
|
+
visit(scr_slot_to_ptr(a->sparse[i].slot), ctx);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
for (size_t i = 0; i < a->prop_len; i++) {
|
|
445
|
+
if (a->props[i].state == SCR_ARR_VALUE) {
|
|
446
|
+
visit(scr_slot_to_ptr(a->props[i].slot), ctx);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
static void scr_arr_gc_free(void *a0) {
|
|
452
|
+
ScrArr *a = (ScrArr *)a0;
|
|
453
|
+
free(a->data);
|
|
454
|
+
free(a->present);
|
|
455
|
+
free(a->sparse);
|
|
456
|
+
for (size_t i = 0; i < a->prop_len; i++) free(a->props[i].key);
|
|
457
|
+
free(a->props);
|
|
458
|
+
#ifdef SCR_RC_AUDIT
|
|
459
|
+
scr_live_arrays--;
|
|
460
|
+
#endif
|
|
461
|
+
scr_cyc_free(a);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
ScrArr *scr_arr_new_ref(void *(*elem_retain)(void *),
|
|
465
|
+
void (*elem_release)(void *),
|
|
466
|
+
ScrTraceFn elem_trace, size_t initial_cap) {
|
|
467
|
+
ScrArr *a;
|
|
468
|
+
if (elem_trace) {
|
|
469
|
+
a = scr_cyc_alloc(sizeof(ScrArr), &scr_arr_trace_v, &scr_arr_gc_free);
|
|
470
|
+
} else {
|
|
471
|
+
a = malloc(sizeof(ScrArr));
|
|
472
|
+
if (!a) scr_arr_oom();
|
|
473
|
+
}
|
|
474
|
+
a->rc = 1;
|
|
475
|
+
a->len = 0;
|
|
476
|
+
a->cap = 0;
|
|
477
|
+
a->elem = SCR_ELEM_REF;
|
|
478
|
+
a->elem_retain = elem_retain;
|
|
479
|
+
a->elem_release = elem_release;
|
|
480
|
+
a->elem_trace = elem_trace;
|
|
481
|
+
a->data = NULL;
|
|
482
|
+
a->present = NULL;
|
|
483
|
+
a->sparse = NULL;
|
|
484
|
+
a->sparse_len = 0;
|
|
485
|
+
a->sparse_cap = 0;
|
|
486
|
+
a->props = NULL;
|
|
487
|
+
a->prop_len = 0;
|
|
488
|
+
a->prop_cap = 0;
|
|
489
|
+
if (initial_cap > 0) scr_arr_grow_dense(a, initial_cap);
|
|
490
|
+
#ifdef SCR_RC_AUDIT
|
|
491
|
+
scr_live_arrays++;
|
|
492
|
+
#endif
|
|
493
|
+
return a;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
void scr_arr_release(ScrArr *a) {
|
|
497
|
+
if (!a || a->rc == SIZE_MAX) return; /* NULL: an uninitialized `let` local */
|
|
498
|
+
if (--a->rc == 0) {
|
|
499
|
+
if (a->elem_trace) scr_cyc_on_dead(a);
|
|
500
|
+
if (scr_elem_is_ref(a->elem)) {
|
|
501
|
+
for (size_t i = 0; i < a->cap; i++) {
|
|
502
|
+
if (a->present[i] != SCR_ARR_HOLE) {
|
|
503
|
+
uint64_t old = a->data[i];
|
|
504
|
+
uint8_t state = a->present[i];
|
|
505
|
+
a->present[i] = 0;
|
|
506
|
+
a->data[i] = 0;
|
|
507
|
+
if (state == SCR_ARR_VALUE) scr_elem_release(a, old);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
while (a->sparse_len > 0) {
|
|
511
|
+
size_t i = a->sparse_len - 1;
|
|
512
|
+
uint64_t old = a->sparse[i].slot;
|
|
513
|
+
uint8_t state = a->sparse[i].state;
|
|
514
|
+
a->sparse_len = i;
|
|
515
|
+
if (state == SCR_ARR_VALUE) scr_elem_release(a, old);
|
|
516
|
+
}
|
|
517
|
+
while (a->prop_len > 0) {
|
|
518
|
+
size_t i = a->prop_len - 1;
|
|
519
|
+
uint64_t old = a->props[i].slot;
|
|
520
|
+
uint8_t state = a->props[i].state;
|
|
521
|
+
free(a->props[i].key);
|
|
522
|
+
a->prop_len = i;
|
|
523
|
+
if (state == SCR_ARR_VALUE) scr_elem_release(a, old);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (a->elem_trace) {
|
|
527
|
+
scr_arr_gc_free(a);
|
|
528
|
+
} else {
|
|
529
|
+
free(a->data);
|
|
530
|
+
free(a->present);
|
|
531
|
+
free(a->sparse);
|
|
532
|
+
for (size_t i = 0; i < a->prop_len; i++) free(a->props[i].key);
|
|
533
|
+
free(a->props);
|
|
534
|
+
#ifdef SCR_RC_AUDIT
|
|
535
|
+
scr_live_arrays--;
|
|
536
|
+
#endif
|
|
537
|
+
free(a);
|
|
538
|
+
}
|
|
539
|
+
} else if (a->elem_trace) {
|
|
540
|
+
scr_cyc_on_release(a); /* possible cycle root; may collect */
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
double scr_arr_len(ScrArr *a) { return (double)a->len; }
|
|
545
|
+
|
|
546
|
+
bool scr_arr_has(const ScrArr *a, double i) {
|
|
547
|
+
size_t idx;
|
|
548
|
+
if (!scr_arr_valid_index(i, &idx)) return scr_arr_prop_get(a, i, NULL);
|
|
549
|
+
if (idx >= a->len) return false;
|
|
550
|
+
return scr_arr_slot_at(a, idx, NULL);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
double scr_arr_state(const ScrArr *a, double i) {
|
|
554
|
+
size_t idx;
|
|
555
|
+
if (!scr_arr_valid_index(i, &idx)) {
|
|
556
|
+
uint8_t state;
|
|
557
|
+
return scr_arr_prop_get_state(a, i, NULL, &state)
|
|
558
|
+
? (double)state
|
|
559
|
+
: (double)SCR_ARR_HOLE;
|
|
560
|
+
}
|
|
561
|
+
if (idx >= a->len) return (double)SCR_ARR_HOLE;
|
|
562
|
+
return (double)scr_arr_state_at(a, idx, NULL);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
double scr_arr_next_present(const ScrArr *a, double start) {
|
|
566
|
+
if (!(start < (double)a->len)) return (double)a->len;
|
|
567
|
+
size_t i = start > 0 ? (size_t)ceil(start) : 0;
|
|
568
|
+
size_t end = a->cap < a->len ? a->cap : a->len;
|
|
569
|
+
for (; i < end; i++) {
|
|
570
|
+
if (a->present[i] != SCR_ARR_HOLE) return (double)i;
|
|
571
|
+
}
|
|
572
|
+
size_t pos = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, i);
|
|
573
|
+
if (pos < a->sparse_len && a->sparse[pos].index < a->len) {
|
|
574
|
+
return (double)a->sparse[pos].index;
|
|
575
|
+
}
|
|
576
|
+
return (double)a->len;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
static void scr_arr_invalid_length(double length) {
|
|
580
|
+
(void)length;
|
|
581
|
+
static const char msg[] = "Invalid array length";
|
|
582
|
+
scr_throw_error_msg(SCR_ERR_RANGE, msg, sizeof msg - 1);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
void scr_arr_set_len(ScrArr *a, double length) {
|
|
586
|
+
if (!(length >= 0) || !isfinite(length) || length != trunc(length) ||
|
|
587
|
+
length > (double)SCR_ARR_MAX_LENGTH) {
|
|
588
|
+
scr_arr_invalid_length(length);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
size_t next = (size_t)length;
|
|
592
|
+
if (next < a->len) {
|
|
593
|
+
/* Spare capacity is already empty. Repeatedly clearing a reused work
|
|
594
|
+
* array must cost only the elements removed, not its historical peak. */
|
|
595
|
+
size_t dense_end = a->len < a->cap ? a->len : a->cap;
|
|
596
|
+
size_t dense_stop = next < dense_end ? next : dense_end;
|
|
597
|
+
if (scr_elem_is_ref(a->elem)) {
|
|
598
|
+
for (size_t i = dense_stop; i < dense_end; i++) {
|
|
599
|
+
if (a->present[i] != SCR_ARR_HOLE) {
|
|
600
|
+
uint64_t old = a->data[i];
|
|
601
|
+
uint8_t state = a->present[i];
|
|
602
|
+
a->present[i] = 0;
|
|
603
|
+
a->data[i] = 0;
|
|
604
|
+
if (state == SCR_ARR_VALUE) scr_elem_release(a, old);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
size_t keep = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, next);
|
|
608
|
+
while (a->sparse_len > keep) {
|
|
609
|
+
size_t i = a->sparse_len - 1;
|
|
610
|
+
uint64_t old = a->sparse[i].slot;
|
|
611
|
+
uint8_t state = a->sparse[i].state;
|
|
612
|
+
a->sparse_len = i;
|
|
613
|
+
if (state == SCR_ARR_VALUE) scr_elem_release(a, old);
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
for (size_t i = dense_stop; i < dense_end; i++) {
|
|
617
|
+
a->present[i] = 0;
|
|
618
|
+
a->data[i] = 0;
|
|
619
|
+
}
|
|
620
|
+
a->sparse_len = scr_arr_sparse_lower_bound(a->sparse, a->sparse_len, next);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
a->len = next;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
void scr_arr_copy_index(ScrArr *dst, size_t dst_index, const ScrArr *src,
|
|
627
|
+
size_t src_index) {
|
|
628
|
+
uint64_t slot;
|
|
629
|
+
uint8_t state = scr_arr_state_at(src, src_index, &slot);
|
|
630
|
+
if (state == SCR_ARR_HOLE) return;
|
|
631
|
+
if (state == SCR_ARR_VALUE) slot = scr_elem_retain_slot(src, slot);
|
|
632
|
+
scr_arr_replace_state_owned(dst, dst_index, slot, state);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
void scr_arr_copy_range(ScrArr *dst, size_t dst_start, const ScrArr *src,
|
|
636
|
+
size_t src_start, size_t count, bool reverse) {
|
|
637
|
+
scr_arr_copy_range_ex(dst, dst_start, src, src_start, count, reverse, false);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
void scr_arr_copy_range_ex(ScrArr *dst, size_t dst_start, const ScrArr *src,
|
|
641
|
+
size_t src_start, size_t count, bool reverse,
|
|
642
|
+
bool materialize_holes) {
|
|
643
|
+
if (count == 0) return;
|
|
644
|
+
size_t end = src_start + count;
|
|
645
|
+
size_t dense_start = src_start < src->cap ? src_start : src->cap;
|
|
646
|
+
size_t dense_end = end < src->cap ? end : src->cap;
|
|
647
|
+
for (size_t i = dense_start; i < dense_end; i++) {
|
|
648
|
+
size_t off = reverse ? count - 1 - (i - src_start) : i - src_start;
|
|
649
|
+
uint8_t state = scr_arr_state_at(src, i, NULL);
|
|
650
|
+
if (state == SCR_ARR_HOLE) {
|
|
651
|
+
if (materialize_holes) scr_arr_replace_state_owned(dst, dst_start + off, 0, SCR_ARR_UNDEFINED);
|
|
652
|
+
} else {
|
|
653
|
+
scr_arr_copy_index(dst, dst_start + off, src, i);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
size_t pos = scr_arr_sparse_lower_bound(src->sparse, src->sparse_len, src_start);
|
|
657
|
+
for (; pos < src->sparse_len && src->sparse[pos].index < end; pos++) {
|
|
658
|
+
size_t i = src->sparse[pos].index;
|
|
659
|
+
size_t off = reverse ? count - 1 - (i - src_start) : i - src_start;
|
|
660
|
+
scr_arr_copy_index(dst, dst_start + off, src, i);
|
|
661
|
+
}
|
|
662
|
+
if (materialize_holes) {
|
|
663
|
+
size_t first = dense_end > src_start ? dense_end : src_start;
|
|
664
|
+
for (size_t i = first; i < end; i++) {
|
|
665
|
+
if (scr_arr_state_at(src, i, NULL) == SCR_ARR_HOLE) {
|
|
666
|
+
size_t off = reverse ? count - 1 - (i - src_start) : i - src_start;
|
|
667
|
+
scr_arr_replace_state_owned(dst, dst_start + off, 0, SCR_ARR_UNDEFINED);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/* ── Math.max/min over one spread number[] ─────────────────────────────
|
|
674
|
+
* The JS fold exactly (ECMA Math.max/min applied to the elements): any
|
|
675
|
+
* NaN poisons the result, +0 beats -0 for max (the reverse for min), and
|
|
676
|
+
* the empty array yields the zero-argument constants. Borrows the array. */
|
|
677
|
+
double scr_math_max_arr(ScrArr *a) {
|
|
678
|
+
double best = -INFINITY;
|
|
679
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
680
|
+
uint64_t slot;
|
|
681
|
+
if (scr_arr_state_at(a, i, &slot) != SCR_ARR_VALUE) return NAN;
|
|
682
|
+
double v = scr_slot_to_f64(slot);
|
|
683
|
+
if (isnan(v)) return v;
|
|
684
|
+
if (v > best || (v == 0.0 && best == 0.0 && !signbit(v))) best = v;
|
|
685
|
+
}
|
|
686
|
+
return best;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
double scr_math_min_arr(ScrArr *a) {
|
|
690
|
+
double best = INFINITY;
|
|
691
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
692
|
+
uint64_t slot;
|
|
693
|
+
if (scr_arr_state_at(a, i, &slot) != SCR_ARR_VALUE) return NAN;
|
|
694
|
+
double v = scr_slot_to_f64(slot);
|
|
695
|
+
if (isnan(v)) return v;
|
|
696
|
+
if (v < best || (v == 0.0 && best == 0.0 && signbit(v))) best = v;
|
|
697
|
+
}
|
|
698
|
+
return best;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/* Math.hypot is variadic. Scale before summing to avoid intermediate
|
|
702
|
+
* overflow/underflow, and scan every element so Infinity wins over NaN. */
|
|
703
|
+
double scr_math_hypot_arr(ScrArr *a) {
|
|
704
|
+
double scale = 0.0;
|
|
705
|
+
bool has_nan = false;
|
|
706
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
707
|
+
uint64_t slot;
|
|
708
|
+
if (scr_arr_state_at(a, i, &slot) != SCR_ARR_VALUE) {
|
|
709
|
+
has_nan = true;
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
double v = fabs(scr_slot_to_f64(slot));
|
|
713
|
+
if (isinf(v)) return INFINITY;
|
|
714
|
+
if (isnan(v)) has_nan = true;
|
|
715
|
+
else if (v > scale) scale = v;
|
|
716
|
+
}
|
|
717
|
+
if (has_nan) return NAN;
|
|
718
|
+
if (scale == 0.0) return 0.0;
|
|
719
|
+
double sum = 0.0;
|
|
720
|
+
double correction = 0.0;
|
|
721
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
722
|
+
uint64_t slot;
|
|
723
|
+
(void)scr_arr_state_at(a, i, &slot);
|
|
724
|
+
double v = scr_slot_to_f64(slot) / scale;
|
|
725
|
+
double term = v * v - correction;
|
|
726
|
+
double next = sum + term;
|
|
727
|
+
correction = (next - sum) - term;
|
|
728
|
+
sum = next;
|
|
729
|
+
}
|
|
730
|
+
return scale * sqrt(sum);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/* ── reads ─────────────────────────────────────────────────────────────── */
|
|
734
|
+
|
|
735
|
+
static uint64_t scr_arr_require_index(const ScrArr *a, size_t idx, double i);
|
|
736
|
+
|
|
737
|
+
static uint64_t scr_arr_require_slot(ScrArr *a, double i) {
|
|
738
|
+
size_t idx;
|
|
739
|
+
if (scr_arr_valid_index(i, &idx)) {
|
|
740
|
+
if (idx < a->len) return scr_arr_require_index(a, idx, i);
|
|
741
|
+
scr_arr_trap_oob(i, a->len);
|
|
742
|
+
}
|
|
743
|
+
uint64_t prop;
|
|
744
|
+
uint8_t state;
|
|
745
|
+
if (scr_arr_prop_get_state(a, i, &prop, &state)) {
|
|
746
|
+
if (state == SCR_ARR_UNDEFINED) {
|
|
747
|
+
char buf[32];
|
|
748
|
+
scr_f64_to_str(i, buf);
|
|
749
|
+
scr_trap_fmt("scriptc: RangeError: numeric property %s is undefined\n", buf);
|
|
750
|
+
}
|
|
751
|
+
return prop;
|
|
752
|
+
}
|
|
753
|
+
char buf[32];
|
|
754
|
+
scr_f64_to_str(i, buf);
|
|
755
|
+
scr_trap_fmt("scriptc: RangeError: numeric property %s is absent\n", buf);
|
|
756
|
+
return 0;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
static uint64_t scr_arr_require_index(const ScrArr *a, size_t idx, double i) {
|
|
760
|
+
uint64_t slot;
|
|
761
|
+
uint8_t state = scr_arr_state_at(a, idx, &slot);
|
|
762
|
+
if (state == SCR_ARR_HOLE) {
|
|
763
|
+
char buf[32];
|
|
764
|
+
scr_f64_to_str(i, buf);
|
|
765
|
+
scr_trap_fmt("scriptc: RangeError: array index %s is a hole (length %zu)\n",
|
|
766
|
+
buf, a->len);
|
|
767
|
+
}
|
|
768
|
+
if (state == SCR_ARR_UNDEFINED) {
|
|
769
|
+
char buf[32];
|
|
770
|
+
scr_f64_to_str(i, buf);
|
|
771
|
+
scr_trap_fmt("scriptc: RangeError: array index %s is undefined (length %zu)\n",
|
|
772
|
+
buf, a->len);
|
|
773
|
+
}
|
|
774
|
+
return slot;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
double scr_arr_get_f64(ScrArr *a, double i) {
|
|
778
|
+
return scr_slot_to_f64(scr_arr_require_slot(a, i));
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
static bool scr_arr_read_value(const ScrArr *a, double i, uint64_t *slot) {
|
|
782
|
+
size_t idx;
|
|
783
|
+
uint8_t state;
|
|
784
|
+
if (scr_arr_valid_index(i, &idx)) {
|
|
785
|
+
if (idx >= a->len) return false;
|
|
786
|
+
state = scr_arr_state_at(a, idx, slot);
|
|
787
|
+
} else if (!scr_arr_prop_get_state(a, i, slot, &state)) {
|
|
788
|
+
return false;
|
|
789
|
+
}
|
|
790
|
+
return state == SCR_ARR_VALUE;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
double scr_arr_get_number(const ScrArr *a, double i) {
|
|
794
|
+
/* Keep this hot numeric-only entry self-contained: routing it through
|
|
795
|
+
* scr_arr_read_value adds an out-of-line call at -O2 on native targets. */
|
|
796
|
+
size_t idx;
|
|
797
|
+
uint64_t slot;
|
|
798
|
+
uint8_t state;
|
|
799
|
+
if (scr_arr_valid_index(i, &idx)) {
|
|
800
|
+
if (idx >= a->len) return NAN;
|
|
801
|
+
state = scr_arr_state_at(a, idx, &slot);
|
|
802
|
+
} else if (!scr_arr_prop_get_state(a, i, &slot, &state)) {
|
|
803
|
+
return NAN;
|
|
804
|
+
}
|
|
805
|
+
return state == SCR_ARR_VALUE ? scr_slot_to_f64(slot) : NAN;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
bool scr_arr_index_eq(const ScrArr *a, double i, const ScrArr *b, double j) {
|
|
809
|
+
uint64_t av, bv;
|
|
810
|
+
/* Avoid two general lookups for the common dense case. Check the range
|
|
811
|
+
* before casting, and distinguish values from holes/present undefined. */
|
|
812
|
+
if (i >= 0 && i < (double)a->cap && i == trunc(i) &&
|
|
813
|
+
j >= 0 && j < (double)b->cap && j == trunc(j)) {
|
|
814
|
+
size_t ai = (size_t)i, bi = (size_t)j;
|
|
815
|
+
bool ap = ai < a->len && a->present[ai] == SCR_ARR_VALUE;
|
|
816
|
+
bool bp = bi < b->len && b->present[bi] == SCR_ARR_VALUE;
|
|
817
|
+
if (!ap || !bp) return ap == bp;
|
|
818
|
+
av = a->data[ai];
|
|
819
|
+
bv = b->data[bi];
|
|
820
|
+
} else {
|
|
821
|
+
bool ap = scr_arr_read_value(a, i, &av);
|
|
822
|
+
bool bp = scr_arr_read_value(b, j, &bv);
|
|
823
|
+
if (!ap || !bp) return ap == bp;
|
|
824
|
+
}
|
|
825
|
+
if (a->elem == SCR_ELEM_F64) return scr_slot_to_f64(av) == scr_slot_to_f64(bv);
|
|
826
|
+
if (a->elem == SCR_ELEM_STR) return scr_str_eq(scr_slot_to_ptr(av), scr_slot_to_ptr(bv));
|
|
827
|
+
return av == bv; /* bool; matching primitive kinds are validated by the IR */
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
bool scr_arr_get_bool(ScrArr *a, double i) {
|
|
831
|
+
return scr_arr_require_slot(a, i) != 0;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
void *scr_arr_get_ref(ScrArr *a, double i) {
|
|
835
|
+
void *p = scr_slot_to_ptr(scr_arr_require_slot(a, i));
|
|
836
|
+
if (!p) return NULL;
|
|
837
|
+
if (a->elem == SCR_ELEM_STR) scr_str_retain((ScrStr *)p);
|
|
838
|
+
else if (a->elem == SCR_ELEM_BYTES) scr_bytes_retain((ScrBytes *)p);
|
|
839
|
+
else if (a->elem == SCR_ELEM_REF) p = a->elem_retain(p);
|
|
840
|
+
else scr_arr_retain((ScrArr *)p);
|
|
841
|
+
return p;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/* ── writes: i == len appends ──────────────────────────────────────────── */
|
|
845
|
+
|
|
846
|
+
static void scr_arr_set_slot(ScrArr *a, double i, uint64_t slot) {
|
|
847
|
+
size_t idx;
|
|
848
|
+
if (!scr_arr_valid_index(i, &idx)) {
|
|
849
|
+
scr_arr_prop_set(a, i, slot);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if (idx >= a->len) a->len = idx + 1;
|
|
853
|
+
/* Unlink-then-release: a release can trigger a cycle collection, which
|
|
854
|
+
* must never see a heap edge whose count was already given up. */
|
|
855
|
+
scr_arr_replace_owned(a, idx, slot);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
void scr_arr_set_f64(ScrArr *a, double i, double v) {
|
|
859
|
+
scr_arr_set_slot(a, i, scr_slot_from_f64(v));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
void scr_arr_set_bool(ScrArr *a, double i, bool v) {
|
|
863
|
+
scr_arr_set_slot(a, i, (uint64_t)(v ? 1 : 0));
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
void scr_arr_set_ref(ScrArr *a, double i, void *v) {
|
|
867
|
+
scr_arr_set_slot(a, i, scr_slot_from_ptr(v));
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
void scr_arr_set_undefined(ScrArr *a, double i) {
|
|
871
|
+
size_t idx;
|
|
872
|
+
if (!scr_arr_valid_index(i, &idx)) {
|
|
873
|
+
scr_arr_prop_set_undefined(a, i);
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
if (idx >= a->len) a->len = idx + 1;
|
|
877
|
+
scr_arr_replace_state_owned(a, idx, 0, SCR_ARR_UNDEFINED);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
bool scr_arr_delete(ScrArr *a, double i) {
|
|
881
|
+
size_t idx;
|
|
882
|
+
if (!scr_arr_valid_index(i, &idx)) return scr_arr_prop_delete(a, i);
|
|
883
|
+
if (idx >= a->len) return false;
|
|
884
|
+
uint64_t old;
|
|
885
|
+
uint8_t state;
|
|
886
|
+
if (!scr_arr_take_state(a, idx, &old, &state)) return false;
|
|
887
|
+
if (state == SCR_ARR_VALUE && scr_elem_is_ref(a->elem)) {
|
|
888
|
+
scr_elem_release(a, old);
|
|
889
|
+
}
|
|
890
|
+
return true;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/* ── push / pop ────────────────────────────────────────────────────────── */
|
|
894
|
+
|
|
895
|
+
static double scr_arr_push_slot(ScrArr *a, uint64_t slot) {
|
|
896
|
+
size_t idx = scr_arr_check_index(a, (double)a->len, true);
|
|
897
|
+
scr_arr_store_owned(a, idx, slot);
|
|
898
|
+
a->len++;
|
|
899
|
+
return (double)a->len;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
double scr_arr_push_f64(ScrArr *a, double v) {
|
|
903
|
+
return scr_arr_push_slot(a, scr_slot_from_f64(v));
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
double scr_arr_push_bool(ScrArr *a, bool v) {
|
|
907
|
+
return scr_arr_push_slot(a, (uint64_t)(v ? 1 : 0));
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
double scr_arr_push_ref(ScrArr *a, void *v) {
|
|
911
|
+
return scr_arr_push_slot(a, scr_slot_from_ptr(v));
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
double scr_arr_push_spread(ScrArr *a, const ScrArr *src) {
|
|
915
|
+
size_t old_len = a->len;
|
|
916
|
+
size_t add = src->len;
|
|
917
|
+
if (add > SCR_ARR_MAX_LENGTH - old_len) scr_arr_oom();
|
|
918
|
+
if (src == a) {
|
|
919
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
920
|
+
a->len = 0;
|
|
921
|
+
for (size_t i = 0; i < old_len; i++) {
|
|
922
|
+
uint64_t slot;
|
|
923
|
+
uint8_t state = scr_arr_state_at_storage(&old, i, &slot);
|
|
924
|
+
if (state != SCR_ARR_HOLE) scr_arr_store_state_owned(a, i, slot, state);
|
|
925
|
+
if (state == SCR_ARR_VALUE) {
|
|
926
|
+
scr_arr_store_owned(a, old_len + i, scr_elem_retain_slot(a, slot));
|
|
927
|
+
} else {
|
|
928
|
+
scr_arr_store_state_owned(a, old_len + i, 0, SCR_ARR_UNDEFINED);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
a->len = old_len + add;
|
|
932
|
+
scr_arr_free_storage(&old);
|
|
933
|
+
return (double)a->len;
|
|
934
|
+
}
|
|
935
|
+
a->len = old_len + add;
|
|
936
|
+
for (size_t i = 0; i < add; i++) {
|
|
937
|
+
uint64_t slot;
|
|
938
|
+
uint8_t state = scr_arr_state_at(src, i, &slot);
|
|
939
|
+
if (state == SCR_ARR_VALUE) {
|
|
940
|
+
scr_arr_store_owned(a, old_len + i, scr_elem_retain_slot(src, slot));
|
|
941
|
+
} else {
|
|
942
|
+
scr_arr_store_state_owned(a, old_len + i, 0, SCR_ARR_UNDEFINED);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return (double)a->len;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
double scr_arr_concat_copy(ScrArr *a, const ScrArr *src) {
|
|
949
|
+
size_t old_len = a->len;
|
|
950
|
+
size_t add = src->len;
|
|
951
|
+
if (add > SCR_ARR_MAX_LENGTH - old_len) scr_arr_oom();
|
|
952
|
+
if (src == a) {
|
|
953
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
954
|
+
a->len = 0;
|
|
955
|
+
for (size_t i = 0; i < old_len; i++) {
|
|
956
|
+
uint64_t slot;
|
|
957
|
+
uint8_t state = scr_arr_state_at_storage(&old, i, &slot);
|
|
958
|
+
if (state != SCR_ARR_HOLE) scr_arr_store_state_owned(a, i, slot, state);
|
|
959
|
+
if (state == SCR_ARR_VALUE) {
|
|
960
|
+
scr_arr_store_owned(a, old_len + i, scr_elem_retain_slot(a, slot));
|
|
961
|
+
} else if (state == SCR_ARR_UNDEFINED) {
|
|
962
|
+
scr_arr_store_state_owned(a, old_len + i, 0, state);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
a->len = old_len + add;
|
|
966
|
+
scr_arr_free_storage(&old);
|
|
967
|
+
return (double)a->len;
|
|
968
|
+
}
|
|
969
|
+
a->len = old_len + add;
|
|
970
|
+
for (size_t i = 0; i < src->cap; i++) {
|
|
971
|
+
if (src->present[i] != SCR_ARR_HOLE) {
|
|
972
|
+
scr_arr_copy_index(a, old_len + i, src, i);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
for (size_t i = 0; i < src->sparse_len; i++) {
|
|
976
|
+
scr_arr_copy_index(a, old_len + src->sparse[i].index, src,
|
|
977
|
+
src->sparse[i].index);
|
|
978
|
+
}
|
|
979
|
+
return (double)a->len;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/* ── unshift / reverse ──────────────────────────────────────────────────
|
|
983
|
+
* Single-element unshift takes ownership, matching push. The emitter calls
|
|
984
|
+
* it from right to left after evaluating every variadic argument, preserving
|
|
985
|
+
* JS argument order without a temporary array. The spread form borrows and
|
|
986
|
+
* retains its source, snapshots the count, and handles self-spread after the
|
|
987
|
+
* tail move by reading the relocated original block. */
|
|
988
|
+
static double scr_arr_unshift_slot(ScrArr *a, uint64_t slot) {
|
|
989
|
+
if (a->len == SCR_ARR_MAX_LENGTH) {
|
|
990
|
+
scr_arr_trap_oob((double)a->len, a->len);
|
|
991
|
+
}
|
|
992
|
+
size_t old_len = a->len;
|
|
993
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
994
|
+
a->len = 0;
|
|
995
|
+
scr_arr_store_owned(a, 0, slot);
|
|
996
|
+
for (size_t i = 0; i < old.cap; i++) {
|
|
997
|
+
if (old.present[i]) scr_arr_store_state_owned(a, i + 1, old.data[i], old.present[i]);
|
|
998
|
+
}
|
|
999
|
+
for (size_t i = 0; i < old.sparse_len; i++) {
|
|
1000
|
+
scr_arr_store_state_owned(a, old.sparse[i].index + 1, old.sparse[i].slot,
|
|
1001
|
+
old.sparse[i].state);
|
|
1002
|
+
}
|
|
1003
|
+
a->len = old_len + 1;
|
|
1004
|
+
scr_arr_free_storage(&old);
|
|
1005
|
+
return (double)a->len;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
double scr_arr_unshift_f64(ScrArr *a, double v) {
|
|
1009
|
+
return scr_arr_unshift_slot(a, scr_slot_from_f64(v));
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
double scr_arr_unshift_bool(ScrArr *a, bool v) {
|
|
1013
|
+
return scr_arr_unshift_slot(a, (uint64_t)(v ? 1 : 0));
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
double scr_arr_unshift_ref(ScrArr *a, void *v) {
|
|
1017
|
+
return scr_arr_unshift_slot(a, scr_slot_from_ptr(v));
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
double scr_arr_unshift_spread(ScrArr *a, const ScrArr *src) {
|
|
1021
|
+
size_t old_len = a->len;
|
|
1022
|
+
size_t add = src->len;
|
|
1023
|
+
if (add == 0) return (double)old_len;
|
|
1024
|
+
if (add > SCR_ARR_MAX_LENGTH - old_len) scr_arr_oom();
|
|
1025
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
1026
|
+
a->len = 0;
|
|
1027
|
+
for (size_t i = 0; i < add; i++) {
|
|
1028
|
+
uint64_t slot;
|
|
1029
|
+
uint8_t state = src == a
|
|
1030
|
+
? scr_arr_state_at_storage(&old, i, &slot)
|
|
1031
|
+
: scr_arr_state_at(src, i, &slot);
|
|
1032
|
+
if (state == SCR_ARR_VALUE) {
|
|
1033
|
+
scr_arr_store_owned(a, i, scr_arr_retain_state_slot(src == a ? a : src, slot, state));
|
|
1034
|
+
} else {
|
|
1035
|
+
scr_arr_store_state_owned(a, i, 0, SCR_ARR_UNDEFINED);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
for (size_t i = 0; i < old.cap; i++) {
|
|
1039
|
+
if (old.present[i] != SCR_ARR_HOLE) {
|
|
1040
|
+
scr_arr_store_state_owned(a, i + add, old.data[i], old.present[i]);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
for (size_t i = 0; i < old.sparse_len; i++) {
|
|
1044
|
+
scr_arr_store_state_owned(a, old.sparse[i].index + add,
|
|
1045
|
+
old.sparse[i].slot, old.sparse[i].state);
|
|
1046
|
+
}
|
|
1047
|
+
a->len = old_len + add;
|
|
1048
|
+
scr_arr_free_storage(&old);
|
|
1049
|
+
return (double)a->len;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
ScrArr *scr_arr_reverse(ScrArr *a) {
|
|
1053
|
+
size_t len = a->len;
|
|
1054
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
1055
|
+
a->len = len;
|
|
1056
|
+
for (size_t i = 0; i < old.cap; i++) {
|
|
1057
|
+
if (old.present[i]) scr_arr_store_state_owned(a, len - 1 - i, old.data[i], old.present[i]);
|
|
1058
|
+
}
|
|
1059
|
+
for (size_t i = 0; i < old.sparse_len; i++) {
|
|
1060
|
+
scr_arr_store_state_owned(a, len - 1 - old.sparse[i].index,
|
|
1061
|
+
old.sparse[i].slot, old.sparse[i].state);
|
|
1062
|
+
}
|
|
1063
|
+
scr_arr_free_storage(&old);
|
|
1064
|
+
return scr_arr_retain(a);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
uint8_t scr_arr_pop_state(ScrArr *a, uint64_t *slot_out) {
|
|
1068
|
+
if (slot_out) *slot_out = 0;
|
|
1069
|
+
if (a->len == 0) return SCR_ARR_HOLE;
|
|
1070
|
+
size_t idx = a->len - 1;
|
|
1071
|
+
uint64_t slot = 0;
|
|
1072
|
+
uint8_t state = SCR_ARR_HOLE;
|
|
1073
|
+
if (!scr_arr_take_state(a, idx, &slot, &state)) state = SCR_ARR_HOLE;
|
|
1074
|
+
a->len = idx;
|
|
1075
|
+
if (slot_out) *slot_out = slot;
|
|
1076
|
+
return state;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
static uint64_t scr_arr_pop_slot(ScrArr *a) {
|
|
1080
|
+
uint64_t slot = 0;
|
|
1081
|
+
uint8_t state = scr_arr_pop_state(a, &slot);
|
|
1082
|
+
if (state != SCR_ARR_VALUE) {
|
|
1083
|
+
scr_trap("scriptc: RangeError: pop() returned undefined\n");
|
|
1084
|
+
}
|
|
1085
|
+
return slot;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
double scr_arr_pop_f64(ScrArr *a) { return scr_slot_to_f64(scr_arr_pop_slot(a)); }
|
|
1089
|
+
|
|
1090
|
+
bool scr_arr_pop_bool(ScrArr *a) { return scr_arr_pop_slot(a) != 0; }
|
|
1091
|
+
|
|
1092
|
+
void *scr_arr_pop_ref(ScrArr *a) { return scr_slot_to_ptr(scr_arr_pop_slot(a)); }
|
|
1093
|
+
|
|
1094
|
+
/* ── shift ─────────────────────────────────────────────────────────────
|
|
1095
|
+
* The first element out, tail sliding down. The EMITTER guards the empty
|
|
1096
|
+
* array (JS answers undefined there — the `elem | undefined` union), so
|
|
1097
|
+
* an empty receiver here is an internal error, pop's discipline. Ref
|
|
1098
|
+
* ownership moves out to the caller (no retain). */
|
|
1099
|
+
uint8_t scr_arr_shift_state(ScrArr *a, uint64_t *slot_out) {
|
|
1100
|
+
if (slot_out) *slot_out = 0;
|
|
1101
|
+
if (a->len == 0) return SCR_ARR_HOLE;
|
|
1102
|
+
size_t old_len = a->len;
|
|
1103
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
1104
|
+
uint64_t s = 0;
|
|
1105
|
+
uint8_t state = scr_arr_state_at_storage(&old, 0, &s);
|
|
1106
|
+
a->len = 0;
|
|
1107
|
+
for (size_t i = 1; i < old.cap; i++) {
|
|
1108
|
+
if (old.present[i]) scr_arr_store_state_owned(a, i - 1, old.data[i], old.present[i]);
|
|
1109
|
+
}
|
|
1110
|
+
for (size_t i = 0; i < old.sparse_len; i++) {
|
|
1111
|
+
if (old.sparse[i].index > 0) {
|
|
1112
|
+
scr_arr_store_state_owned(a, old.sparse[i].index - 1, old.sparse[i].slot,
|
|
1113
|
+
old.sparse[i].state);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
a->len = old_len - 1;
|
|
1117
|
+
scr_arr_free_storage(&old);
|
|
1118
|
+
if (slot_out) *slot_out = s;
|
|
1119
|
+
return state;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
static uint64_t scr_arr_shift_slot(ScrArr *a) {
|
|
1123
|
+
uint64_t s = 0;
|
|
1124
|
+
uint8_t state = scr_arr_shift_state(a, &s);
|
|
1125
|
+
if (state != SCR_ARR_VALUE) {
|
|
1126
|
+
scr_trap("scriptc: RangeError: shift() returned undefined\n");
|
|
1127
|
+
}
|
|
1128
|
+
return s;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
double scr_arr_shift_f64(ScrArr *a) { return scr_slot_to_f64(scr_arr_shift_slot(a)); }
|
|
1132
|
+
|
|
1133
|
+
bool scr_arr_shift_bool(ScrArr *a) { return scr_arr_shift_slot(a) != 0; }
|
|
1134
|
+
|
|
1135
|
+
void *scr_arr_shift_ref(ScrArr *a) { return scr_slot_to_ptr(scr_arr_shift_slot(a)); }
|
|
1136
|
+
|
|
1137
|
+
/* ── splice (the removal forms) ────────────────────────────────────────
|
|
1138
|
+
* a.splice(start, deleteCount) with Node's exact index handling: start
|
|
1139
|
+
* goes through ToIntegerOrInfinity with negative-from-the-end resolution
|
|
1140
|
+
* and clamps to [0, len]; deleteCount clamps to [0, len - start] (the
|
|
1141
|
+
* omitted-count form passes +Infinity — remove to the end). The removed
|
|
1142
|
+
* elements come back as a fresh +1 array IN ORDER, their ownership MOVED
|
|
1143
|
+
* out of the receiver (no retain/release churn); the tail slides down.
|
|
1144
|
+
* Borrows a. */
|
|
1145
|
+
ScrArr *scr_arr_splice(ScrArr *a, double start, double deleteCount) {
|
|
1146
|
+
double len = (double)a->len;
|
|
1147
|
+
double s0 = isnan(start) ? 0 : trunc(start);
|
|
1148
|
+
if (s0 < 0) s0 += len;
|
|
1149
|
+
size_t from = s0 <= 0 ? 0 : s0 >= len ? a->len : (size_t)s0;
|
|
1150
|
+
double avail = len - (double)from;
|
|
1151
|
+
double d0 = isnan(deleteCount) ? 0 : trunc(deleteCount);
|
|
1152
|
+
size_t n = d0 <= 0 ? 0 : d0 >= avail ? (size_t)avail : (size_t)d0;
|
|
1153
|
+
ScrArr *out =
|
|
1154
|
+
a->elem == SCR_ELEM_REF
|
|
1155
|
+
? scr_arr_new_ref(a->elem_retain, a->elem_release, a->elem_trace, n ? n : 1)
|
|
1156
|
+
: scr_arr_new(a->elem, n ? n : 1);
|
|
1157
|
+
out->len = n;
|
|
1158
|
+
size_t old_len = a->len;
|
|
1159
|
+
ScrArrStorage old = scr_arr_take_storage(a);
|
|
1160
|
+
a->len = 0;
|
|
1161
|
+
for (size_t i = 0; i < old.cap; i++) {
|
|
1162
|
+
if (old.present[i] == SCR_ARR_HOLE) continue;
|
|
1163
|
+
uint8_t state = old.present[i];
|
|
1164
|
+
size_t dst;
|
|
1165
|
+
if (i < from) {
|
|
1166
|
+
dst = i;
|
|
1167
|
+
scr_arr_store_state_owned(a, dst, old.data[i], state);
|
|
1168
|
+
} else if (i >= from + n) {
|
|
1169
|
+
dst = i - n;
|
|
1170
|
+
scr_arr_store_state_owned(a, dst, old.data[i], state);
|
|
1171
|
+
} else {
|
|
1172
|
+
dst = i - from;
|
|
1173
|
+
scr_arr_store_state_owned(out, dst, old.data[i], state);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
for (size_t j = 0; j < old.sparse_len; j++) {
|
|
1177
|
+
size_t i = old.sparse[j].index;
|
|
1178
|
+
if (i < from) {
|
|
1179
|
+
scr_arr_store_state_owned(a, i, old.sparse[j].slot, old.sparse[j].state);
|
|
1180
|
+
} else if (i >= from + n) {
|
|
1181
|
+
scr_arr_store_state_owned(a, i - n, old.sparse[j].slot, old.sparse[j].state);
|
|
1182
|
+
} else {
|
|
1183
|
+
scr_arr_store_state_owned(out, i - from, old.sparse[j].slot, old.sparse[j].state);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
a->len = old_len - n;
|
|
1187
|
+
scr_arr_free_storage(&old);
|
|
1188
|
+
return out;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/* Insert the evaluated arguments at the original start position. The first
|
|
1192
|
+
* splice moves removed slots out, and the second moves the remaining tail
|
|
1193
|
+
* out. Appending items follows array iteration (a hole becomes undefined);
|
|
1194
|
+
* appending the tail follows indexed copying (holes stay holes). */
|
|
1195
|
+
ScrArr *scr_arr_splice_insert(ScrArr *a, double start, double deleteCount,
|
|
1196
|
+
const ScrArr *items) {
|
|
1197
|
+
double len = (double)a->len;
|
|
1198
|
+
double s0 = isnan(start) ? 0 : trunc(start);
|
|
1199
|
+
if (s0 < 0) s0 += len;
|
|
1200
|
+
size_t from = s0 <= 0 ? 0 : s0 >= len ? a->len : (size_t)s0;
|
|
1201
|
+
double avail = len - (double)from;
|
|
1202
|
+
double d0 = isnan(deleteCount) ? 0 : trunc(deleteCount);
|
|
1203
|
+
size_t n = d0 <= 0 ? 0 : d0 >= avail ? (size_t)avail : (size_t)d0;
|
|
1204
|
+
if (items->len > SCR_ARR_MAX_LENGTH - (a->len - n)) scr_arr_oom();
|
|
1205
|
+
ScrArr *removed = scr_arr_splice(a, start, deleteCount);
|
|
1206
|
+
ScrArr *tail = scr_arr_splice(a, (double)from, INFINITY);
|
|
1207
|
+
scr_arr_push_spread(a, items);
|
|
1208
|
+
scr_arr_concat_copy(a, tail);
|
|
1209
|
+
scr_arr_release(tail);
|
|
1210
|
+
return removed;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/* FlattenIntoArray for static arrays: a dense copy with depth zero, or one
|
|
1214
|
+
* level over array elements. The frontend supplies an empty result of the
|
|
1215
|
+
* correct element kind; inner holes are skipped and present undefined stays
|
|
1216
|
+
* present. This function borrows both inputs and returns a retained result. */
|
|
1217
|
+
ScrArr *scr_arr_flat_copy(const ScrArr *a, ScrArr *out, bool flatten) {
|
|
1218
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
1219
|
+
uint64_t slot;
|
|
1220
|
+
uint8_t state = scr_arr_state_at(a, i, &slot);
|
|
1221
|
+
if (state == SCR_ARR_HOLE) continue;
|
|
1222
|
+
if (flatten && state == SCR_ARR_VALUE) {
|
|
1223
|
+
const ScrArr *inner = (const ScrArr *)scr_slot_to_ptr(slot);
|
|
1224
|
+
for (size_t j = 0; j < inner->len; j++) {
|
|
1225
|
+
if (scr_arr_state_at(inner, j, NULL) == SCR_ARR_HOLE) continue;
|
|
1226
|
+
if (out->len == SCR_ARR_MAX_LENGTH) scr_arr_oom();
|
|
1227
|
+
size_t at = out->len++;
|
|
1228
|
+
scr_arr_copy_index(out, at, inner, j);
|
|
1229
|
+
}
|
|
1230
|
+
} else {
|
|
1231
|
+
if (out->len == SCR_ARR_MAX_LENGTH) scr_arr_oom();
|
|
1232
|
+
size_t at = out->len++;
|
|
1233
|
+
scr_arr_copy_index(out, at, a, i);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
return scr_arr_retain(out);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/* ── indexOf / includes ────────────────────────────────────────────────
|
|
1240
|
+
* indexOf uses JS strict equality (===): NaN never matches (NaN !== NaN),
|
|
1241
|
+
* -0 matches 0 (C == agrees on both). includes uses SameValueZero: the one
|
|
1242
|
+
* difference is that NaN DOES match NaN. Reference elements: strings by
|
|
1243
|
+
* content (JS strings are primitive values), arrays by pointer identity.
|
|
1244
|
+
* All needles are borrowed. */
|
|
1245
|
+
|
|
1246
|
+
static bool scr_arr_ref_eq(const ScrArr *a, uint64_t slot, void *v) {
|
|
1247
|
+
void *p = scr_slot_to_ptr(slot);
|
|
1248
|
+
if (a->elem == SCR_ELEM_STR) return scr_str_eq((ScrStr *)p, (ScrStr *)v);
|
|
1249
|
+
if (a->elem == SCR_ELEM_REF && a->elem_retain == scr_dyn_retain_v) {
|
|
1250
|
+
return scr_dyn_strict_eq((ScrDyn *)p, (ScrDyn *)v);
|
|
1251
|
+
}
|
|
1252
|
+
return p == v;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
double scr_arr_index_of_f64(ScrArr *a, double v) {
|
|
1256
|
+
for (size_t i = 0; i < a->cap && i < a->len; i++) {
|
|
1257
|
+
if (a->present[i] == SCR_ARR_VALUE && scr_slot_to_f64(a->data[i]) == v) return (double)i;
|
|
1258
|
+
}
|
|
1259
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1260
|
+
if (a->sparse[i].state == SCR_ARR_VALUE && scr_slot_to_f64(a->sparse[i].slot) == v) return (double)a->sparse[i].index;
|
|
1261
|
+
}
|
|
1262
|
+
return -1;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
double scr_arr_index_of_bool(ScrArr *a, bool v) {
|
|
1266
|
+
for (size_t i = 0; i < a->cap && i < a->len; i++) {
|
|
1267
|
+
if (a->present[i] == SCR_ARR_VALUE && ((a->data[i] != 0) == v)) return (double)i;
|
|
1268
|
+
}
|
|
1269
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1270
|
+
if (a->sparse[i].state == SCR_ARR_VALUE && (a->sparse[i].slot != 0) == v) return (double)a->sparse[i].index;
|
|
1271
|
+
}
|
|
1272
|
+
return -1;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
double scr_arr_index_of_ref(ScrArr *a, void *v) {
|
|
1276
|
+
for (size_t i = 0; i < a->cap && i < a->len; i++) {
|
|
1277
|
+
if (a->present[i] == SCR_ARR_VALUE && scr_arr_ref_eq(a, a->data[i], v)) return (double)i;
|
|
1278
|
+
}
|
|
1279
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1280
|
+
if (a->sparse[i].state == SCR_ARR_VALUE && scr_arr_ref_eq(a, a->sparse[i].slot, v)) return (double)a->sparse[i].index;
|
|
1281
|
+
}
|
|
1282
|
+
return -1;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
bool scr_arr_includes_f64(ScrArr *a, double v) {
|
|
1286
|
+
for (size_t i = 0; i < a->cap && i < a->len; i++) {
|
|
1287
|
+
if (a->present[i] != SCR_ARR_VALUE) continue;
|
|
1288
|
+
double x = scr_slot_to_f64(a->data[i]);
|
|
1289
|
+
if (x == v || (x != x && v != v)) return true; /* SameValueZero: NaN hits */
|
|
1290
|
+
}
|
|
1291
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1292
|
+
if (a->sparse[i].state != SCR_ARR_VALUE) continue;
|
|
1293
|
+
double x = scr_slot_to_f64(a->sparse[i].slot);
|
|
1294
|
+
if (x == v || (x != x && v != v)) return true;
|
|
1295
|
+
}
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
bool scr_arr_includes_bool(ScrArr *a, bool v) {
|
|
1300
|
+
return scr_arr_index_of_bool(a, v) >= 0;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
bool scr_arr_includes_ref(ScrArr *a, void *v) {
|
|
1304
|
+
if (a->elem == SCR_ELEM_REF && a->elem_retain == scr_dyn_retain_v) {
|
|
1305
|
+
const ScrDyn *needle = (const ScrDyn *)v;
|
|
1306
|
+
if (needle->kind == SCR_DYN_NUM && needle->v.num != needle->v.num) {
|
|
1307
|
+
for (size_t i = 0; i < a->cap && i < a->len; i++) {
|
|
1308
|
+
if (a->present[i] != SCR_ARR_VALUE) continue;
|
|
1309
|
+
const ScrDyn *d = (const ScrDyn *)scr_slot_to_ptr(a->data[i]);
|
|
1310
|
+
if (d->kind == SCR_DYN_NUM && d->v.num != d->v.num) return true;
|
|
1311
|
+
}
|
|
1312
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1313
|
+
if (a->sparse[i].state != SCR_ARR_VALUE) continue;
|
|
1314
|
+
const ScrDyn *d = (const ScrDyn *)scr_slot_to_ptr(a->sparse[i].slot);
|
|
1315
|
+
if (d->kind == SCR_DYN_NUM && d->v.num != d->v.num) return true;
|
|
1316
|
+
}
|
|
1317
|
+
return false;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return scr_arr_index_of_ref(a, v) >= 0;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/* ── join ──────────────────────────────────────────────────────────────── */
|
|
1324
|
+
|
|
1325
|
+
static void scr_join_append(char **buf, size_t *len, size_t *cap,
|
|
1326
|
+
const char *bytes, size_t n) {
|
|
1327
|
+
if (*len + n > *cap) {
|
|
1328
|
+
size_t cap2 = *cap;
|
|
1329
|
+
while (*len + n > cap2) {
|
|
1330
|
+
if (cap2 > SIZE_MAX / 2) scr_arr_oom();
|
|
1331
|
+
cap2 *= 2;
|
|
1332
|
+
}
|
|
1333
|
+
char *grown = realloc(*buf, cap2);
|
|
1334
|
+
if (!grown) scr_arr_oom();
|
|
1335
|
+
*buf = grown;
|
|
1336
|
+
*cap = cap2;
|
|
1337
|
+
}
|
|
1338
|
+
memcpy(*buf + *len, bytes, n);
|
|
1339
|
+
*len += n;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/* `a.slice(start?, end?)` — a fresh shallow copy of the index range,
|
|
1343
|
+
* JS-exact: indices go through ToIntegerOrInfinity (the emitter fills the
|
|
1344
|
+
* omitted defaults 0 / +Infinity), negatives count from the end, both
|
|
1345
|
+
* clamp to [0, len]. Ref elements RETAIN into the copy — the same
|
|
1346
|
+
* references, exactly JS's shallow copy. Borrows a; returns +1. */
|
|
1347
|
+
ScrArr *scr_arr_slice(ScrArr *a, double start, double end) {
|
|
1348
|
+
/* ToIntegerOrInfinity + relative-index resolution over the LENGTH. */
|
|
1349
|
+
double len = (double)a->len;
|
|
1350
|
+
double s0 = isnan(start) ? 0 : trunc(start);
|
|
1351
|
+
double e0 = isnan(end) ? 0 : trunc(end);
|
|
1352
|
+
if (s0 < 0) s0 += len;
|
|
1353
|
+
if (e0 < 0) e0 += len;
|
|
1354
|
+
size_t from = s0 <= 0 ? 0 : s0 >= len ? a->len : (size_t)s0;
|
|
1355
|
+
size_t to = e0 <= 0 ? 0 : e0 >= len ? a->len : (size_t)e0;
|
|
1356
|
+
size_t n = to > from ? to - from : 0;
|
|
1357
|
+
ScrArr *out =
|
|
1358
|
+
a->elem == SCR_ELEM_REF
|
|
1359
|
+
? scr_arr_new_ref(a->elem_retain, a->elem_release, a->elem_trace, n ? n : 1)
|
|
1360
|
+
: scr_arr_new(a->elem, n ? n : 1);
|
|
1361
|
+
out->len = n;
|
|
1362
|
+
for (size_t i = 0; i < a->cap && i < to; i++) {
|
|
1363
|
+
if (i < from || a->present[i] == SCR_ARR_HOLE) continue;
|
|
1364
|
+
uint8_t state = a->present[i];
|
|
1365
|
+
scr_arr_store_state_owned(out, i - from,
|
|
1366
|
+
scr_arr_retain_state_slot(a, a->data[i], state),
|
|
1367
|
+
state);
|
|
1368
|
+
}
|
|
1369
|
+
for (size_t i = 0; i < a->sparse_len; i++) {
|
|
1370
|
+
size_t index = a->sparse[i].index;
|
|
1371
|
+
if (index >= from && index < to) {
|
|
1372
|
+
scr_arr_store_state_owned(out, index - from,
|
|
1373
|
+
scr_arr_retain_state_slot(a, a->sparse[i].slot,
|
|
1374
|
+
a->sparse[i].state),
|
|
1375
|
+
a->sparse[i].state);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return out;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
ScrStr *scr_arr_join(ScrArr *a, ScrStr *sep) {
|
|
1382
|
+
size_t cap = 64, len = 0;
|
|
1383
|
+
char *buf = malloc(cap);
|
|
1384
|
+
if (!buf) scr_arr_oom();
|
|
1385
|
+
for (size_t i = 0; i < a->len; i++) {
|
|
1386
|
+
if (i > 0) scr_join_append(&buf, &len, &cap, sep->data, sep->len);
|
|
1387
|
+
uint64_t slot;
|
|
1388
|
+
uint8_t state = scr_arr_state_at(a, i, &slot);
|
|
1389
|
+
if (state != SCR_ARR_VALUE) continue;
|
|
1390
|
+
switch (a->elem) {
|
|
1391
|
+
case SCR_ELEM_F64: {
|
|
1392
|
+
char nb[32];
|
|
1393
|
+
size_t n = scr_f64_to_str(scr_slot_to_f64(slot), nb);
|
|
1394
|
+
scr_join_append(&buf, &len, &cap, nb, n);
|
|
1395
|
+
break;
|
|
1396
|
+
}
|
|
1397
|
+
case SCR_ELEM_BOOL:
|
|
1398
|
+
if (slot != 0) scr_join_append(&buf, &len, &cap, "true", 4);
|
|
1399
|
+
else scr_join_append(&buf, &len, &cap, "false", 5);
|
|
1400
|
+
break;
|
|
1401
|
+
case SCR_ELEM_STR: {
|
|
1402
|
+
const ScrStr *s = (const ScrStr *)scr_slot_to_ptr(slot);
|
|
1403
|
+
if (s) scr_join_append(&buf, &len, &cap, s->data, s->len);
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
case SCR_ELEM_ARR:
|
|
1407
|
+
case SCR_ELEM_BYTES:
|
|
1408
|
+
case SCR_ELEM_REF:
|
|
1409
|
+
/* The compiler rejects join on ref-element arrays (SC1090). */
|
|
1410
|
+
scr_trap("scriptc: internal error: join on a ref-element array\n");
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
ScrStr *out = scr_str_new(buf, len);
|
|
1414
|
+
free(buf);
|
|
1415
|
+
return out;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/* String.raw over the template's raw literals and PRE-STRINGIFIED
|
|
1419
|
+
* substitutions (the frontend applies the static ToString per value):
|
|
1420
|
+
* raw[0] sub[0] raw[1] sub[1] ... — substitutions beyond raw.len-1 drop,
|
|
1421
|
+
* missing ones skip, exactly the spec's loop. Both arrays are
|
|
1422
|
+
* SCR_ELEM_STR; borrows both; +1 result. Never throws. */
|
|
1423
|
+
ScrStr *scr_str_raw(ScrArr *raw, ScrArr *subs) {
|
|
1424
|
+
size_t cap = 64, len = 0;
|
|
1425
|
+
char *buf = malloc(cap);
|
|
1426
|
+
if (!buf) scr_arr_oom();
|
|
1427
|
+
for (size_t i = 0; i < raw->len; i++) {
|
|
1428
|
+
uint64_t raw_slot;
|
|
1429
|
+
if (scr_arr_slot_at(raw, i, &raw_slot)) {
|
|
1430
|
+
const ScrStr *s = (const ScrStr *)scr_slot_to_ptr(raw_slot);
|
|
1431
|
+
if (s) scr_join_append(&buf, &len, &cap, s->data, s->len);
|
|
1432
|
+
}
|
|
1433
|
+
if (i + 1 < raw->len && i < subs->len) {
|
|
1434
|
+
uint64_t sub_slot;
|
|
1435
|
+
if (scr_arr_slot_at(subs, i, &sub_slot)) {
|
|
1436
|
+
const ScrStr *v = (const ScrStr *)scr_slot_to_ptr(sub_slot);
|
|
1437
|
+
if (v) scr_join_append(&buf, &len, &cap, v->data, v->len);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
ScrStr *out = scr_str_new(buf, len);
|
|
1442
|
+
free(buf);
|
|
1443
|
+
return out;
|
|
1444
|
+
}
|