@scriptc/cli-darwin-x64 0.0.0 → 0.2.1
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 +3857 -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/v8-number-radix.txt +61 -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 +5762 -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 +1460 -0
- package/dist/lib/runtime-sources/src/scr_assert.c +1538 -0
- package/dist/lib/runtime-sources/src/scr_async.c +3945 -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 +877 -0
- package/dist/lib/runtime-sources/src/scr_bigint.c +898 -0
- package/dist/lib/runtime-sources/src/scr_bigint_assert.c +22 -0
- package/dist/lib/runtime-sources/src/scr_bytes.c +2682 -0
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +1324 -0
- package/dist/lib/runtime-sources/src/scr_child.c +6335 -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 +1759 -0
- package/dist/lib/runtime-sources/src/scr_error.c +419 -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 +484 -0
- package/dist/lib/runtime-sources/src/scr_fetch.c +7479 -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 +5811 -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 +10012 -0
- package/dist/lib/runtime-sources/src/scr_island_manifest.h +153 -0
- package/dist/lib/runtime-sources/src/scr_json.c +8986 -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 +752 -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 +291 -0
- package/dist/lib/runtime-sources/src/scr_number.c +192 -0
- package/dist/lib/runtime-sources/src/scr_object.c +91 -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 +1313 -0
- package/dist/lib/runtime-sources/src/scr_runtime.h +7364 -0
- package/dist/lib/runtime-sources/src/scr_stream.c +3346 -0
- package/dist/lib/runtime-sources/src/scr_string.c +1864 -0
- package/dist/lib/runtime-sources/src/scr_symbol.c +239 -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_text_decoder_labels.h +225 -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 +1400 -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/v8-number-radix/LICENSE +61 -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,1324 @@
|
|
|
1
|
+
/* The OS-facing half of the typed-array/Buffer runtime: fs Buffer reads/
|
|
2
|
+
* writes (scr_lib.c's throw formatting), the fs/promises bytes form
|
|
3
|
+
* (scr_async.c's settled-promise minting), crypto.randomBytes, and the
|
|
4
|
+
* process stream Buffer writes. Split from scr_bytes.c so the pure bytes
|
|
5
|
+
* core links without the lib/async runtimes (the runtime unit tests link
|
|
6
|
+
* exact source lists). */
|
|
7
|
+
#include "scr_runtime.h"
|
|
8
|
+
|
|
9
|
+
#include <errno.h>
|
|
10
|
+
#include <math.h>
|
|
11
|
+
#include <stdio.h>
|
|
12
|
+
#include <stdlib.h>
|
|
13
|
+
#include <string.h>
|
|
14
|
+
#include <time.h>
|
|
15
|
+
#include <fcntl.h>
|
|
16
|
+
#include <dirent.h>
|
|
17
|
+
#include <sys/stat.h>
|
|
18
|
+
#include <unistd.h>
|
|
19
|
+
#include <utime.h>
|
|
20
|
+
#ifndef O_SYNC
|
|
21
|
+
#define O_SYNC 0 /* Windows CRT opens have no separate synchronous flag. */
|
|
22
|
+
#endif
|
|
23
|
+
/* Bionic added glob/globfree in API 28; Android packs target API 26. */
|
|
24
|
+
#if !defined(_WIN32) && !defined(__wasi__) && (!defined(__ANDROID__) || __ANDROID_API__ >= 28)
|
|
25
|
+
#include <glob.h>
|
|
26
|
+
#define SCR_FS_HAS_GLOB 1
|
|
27
|
+
#else
|
|
28
|
+
#define SCR_FS_HAS_GLOB 0
|
|
29
|
+
#endif
|
|
30
|
+
#ifdef __APPLE__
|
|
31
|
+
#include <sys/stat.h> /* lchmod(2) — the fs.lchmodSync ladder's real tail */
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
static void scr_bytes_io_oom(void) {
|
|
35
|
+
scr_trap("scriptc: out of memory\n");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ── fs (the Buffer forms of scr_lib.c's utf8 pair) ────────────────────── */
|
|
39
|
+
|
|
40
|
+
ScrBytes *scr_fs_read_file_bytes(ScrStr *path) {
|
|
41
|
+
FILE *f = fopen(path->data, "rb");
|
|
42
|
+
if (!f) {
|
|
43
|
+
scr_fs_throw(errno, "open", path);
|
|
44
|
+
return NULL;
|
|
45
|
+
}
|
|
46
|
+
size_t cap = 4096, len = 0;
|
|
47
|
+
uint8_t *buf = malloc(cap);
|
|
48
|
+
if (!buf) scr_bytes_io_oom();
|
|
49
|
+
for (;;) {
|
|
50
|
+
if (cap - len < 2048) {
|
|
51
|
+
cap *= 2;
|
|
52
|
+
uint8_t *grown = realloc(buf, cap);
|
|
53
|
+
if (!grown) scr_bytes_io_oom();
|
|
54
|
+
buf = grown;
|
|
55
|
+
}
|
|
56
|
+
size_t n = fread(buf + len, 1, cap - len, f);
|
|
57
|
+
len += n;
|
|
58
|
+
if (n == 0) break;
|
|
59
|
+
}
|
|
60
|
+
if (ferror(f)) {
|
|
61
|
+
int e = errno;
|
|
62
|
+
fclose(f);
|
|
63
|
+
free(buf);
|
|
64
|
+
scr_fs_throw(e, "read", path);
|
|
65
|
+
return NULL;
|
|
66
|
+
}
|
|
67
|
+
fclose(f);
|
|
68
|
+
ScrBytes *b = scr_bytes_new(SCR_BYTES_U8, (double)len);
|
|
69
|
+
memcpy(b->data, buf, len);
|
|
70
|
+
free(buf);
|
|
71
|
+
return b;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* readFileSync's runtime-encoding form (a JS helper's untyped `enc`
|
|
75
|
+
* parameter — test/common fixtures.js): undefined/null answer a Buffer,
|
|
76
|
+
* utf8 answers a string, Node's other real encodings meet the loud
|
|
77
|
+
* not-supported ladder, unknown names throw ERR_UNKNOWN_ENCODING, and an
|
|
78
|
+
* options object dispatches on its `encoding` member (Node's form). +1
|
|
79
|
+
* dyn value, or NULL with the exception pending. */
|
|
80
|
+
ScrDyn *scr_fs_read_file_sync_dyn(ScrStr *path, const ScrDyn *enc) {
|
|
81
|
+
if (enc->kind == SCR_DYN_OBJ) {
|
|
82
|
+
ScrDyn *ev = scr_dyn_obj_get((ScrDyn *)enc, "encoding", 8); /* borrowed */
|
|
83
|
+
return scr_fs_read_file_sync_dyn(path, ev ? ev : scr_dyn_undefined());
|
|
84
|
+
}
|
|
85
|
+
if (enc->kind == SCR_DYN_UNDEF || enc->kind == SCR_DYN_NULL) {
|
|
86
|
+
ScrBytes *b = scr_fs_read_file_bytes(path);
|
|
87
|
+
if (!b) return NULL;
|
|
88
|
+
ScrDyn *d = scr_dyn_new_buffer(b);
|
|
89
|
+
scr_bytes_release(b);
|
|
90
|
+
return d;
|
|
91
|
+
}
|
|
92
|
+
if (enc->kind == SCR_DYN_STR) {
|
|
93
|
+
const ScrStr *e = enc->v.str;
|
|
94
|
+
if ((e->len == 4 && memcmp(e->data, "utf8", 4) == 0) ||
|
|
95
|
+
(e->len == 5 && memcmp(e->data, "utf-8", 5) == 0)) {
|
|
96
|
+
ScrStr *text = scr_fs_read_file(path);
|
|
97
|
+
if (!text) return NULL;
|
|
98
|
+
ScrDyn *d = scr_dyn_new_str(text);
|
|
99
|
+
scr_str_release(text);
|
|
100
|
+
return d;
|
|
101
|
+
}
|
|
102
|
+
static const char *const known[] = { "ascii", "latin1", "binary", "base64",
|
|
103
|
+
"base64url", "hex", "ucs2", "ucs-2", "utf16le", "utf-16le", NULL };
|
|
104
|
+
for (size_t i = 0; known[i]; i++) {
|
|
105
|
+
if (e->len == strlen(known[i]) && memcmp(e->data, known[i], e->len) == 0) {
|
|
106
|
+
char msg[128];
|
|
107
|
+
int n = snprintf(msg, sizeof msg,
|
|
108
|
+
"readFileSync with encoding '%s' is not supported yet (only 'utf8' and Buffer reads here)",
|
|
109
|
+
known[i]);
|
|
110
|
+
scr_throw_error_msg(SCR_ERR_ERROR, msg, (size_t)n);
|
|
111
|
+
return NULL;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
char msg[128];
|
|
115
|
+
int n = snprintf(msg, sizeof msg, "Unknown encoding: %.*s",
|
|
116
|
+
(int)(e->len < 64 ? e->len : 64), e->data);
|
|
117
|
+
scr_throw_error_msg_code(SCR_ERR_TYPE, msg, (size_t)n, "ERR_UNKNOWN_ENCODING");
|
|
118
|
+
return NULL;
|
|
119
|
+
}
|
|
120
|
+
{
|
|
121
|
+
/* Kind rendering stays local: scr_dyn_specific_type lives in the
|
|
122
|
+
* net/emitter-gated handle unit and this one links with bare fs. */
|
|
123
|
+
const char *msg = "The \"options\" argument must be of type string or an instance of Object";
|
|
124
|
+
scr_throw_error_msg_code(SCR_ERR_TYPE, msg, strlen(msg), "ERR_INVALID_ARG_TYPE");
|
|
125
|
+
return NULL;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static void scr_fs_write_bytes_common(ScrStr *path, const ScrBytes *data, const char *mode) {
|
|
130
|
+
FILE *f = fopen(path->data, mode);
|
|
131
|
+
if (!f) {
|
|
132
|
+
scr_fs_throw(errno, "open", path);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
size_t n = data->len * scr_bytes_elem_size(data->elem);
|
|
136
|
+
if (n > 0 && fwrite(data->data, 1, n, f) != n) {
|
|
137
|
+
int e = errno;
|
|
138
|
+
fclose(f);
|
|
139
|
+
scr_fs_throw(e, "write", path);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (fclose(f) != 0) scr_fs_throw(errno, "close", path);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
void scr_fs_write_file_bytes(ScrStr *path, const ScrBytes *data) {
|
|
146
|
+
scr_fs_write_bytes_common(path, data, "wb");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
void scr_fs_append_file_bytes(ScrStr *path, const ScrBytes *data) {
|
|
150
|
+
scr_fs_write_bytes_common(path, data, "ab");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
ScrPromise *scr_fsp_read_file_bytes(ScrStr *path) {
|
|
154
|
+
ScrBytes *b = scr_fs_read_file_bytes(path);
|
|
155
|
+
return scr_promise_settled_ref(b, &scr_bytes_retain_v, &scr_bytes_release_v, NULL);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Native error-first callbacks remain callable values when a platform layer
|
|
159
|
+
* captures them. Argument failures throw at the call; filesystem failures
|
|
160
|
+
* arrive through the callback on the next event-loop turn. The synchronous
|
|
161
|
+
* filesystem spine does the work, as it does for our promise adapters. */
|
|
162
|
+
static bool scr_fs_dyn_absent(const ScrDyn *value);
|
|
163
|
+
static bool scr_fs_cb_chk(const ScrDyn *callback, const char *name);
|
|
164
|
+
static bool scr_fs_path_chk(const ScrDyn *value, const char *name);
|
|
165
|
+
static ScrDyn *scr_fs_cb_arg(ScrDyn *const *args, size_t argc, size_t index) {
|
|
166
|
+
return index < argc ? args[index] : scr_dyn_undefined();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static ScrDyn *scr_fs_cb_option(const ScrDyn *options, const char *name) {
|
|
170
|
+
if (scr_fs_dyn_absent(options)) return scr_dyn_retain(scr_dyn_undefined());
|
|
171
|
+
ScrDyn *object = options->kind == SCR_DYN_TYPED_REF ? scr_dyn_typed_ref_materialize(options) : scr_dyn_retain((ScrDyn *)options);
|
|
172
|
+
if (!object) return NULL;
|
|
173
|
+
ScrDyn *value = scr_dyn_obj_read(object, name, strlen(name));
|
|
174
|
+
scr_dyn_release(object);
|
|
175
|
+
return value;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static double scr_fs_cb_number(const ScrDyn *value, const char *name, double fallback) {
|
|
179
|
+
if (scr_fs_dyn_absent(value)) return fallback;
|
|
180
|
+
if (value->kind == SCR_DYN_BIGINT) return scr_bigint_to_f64(value->v.bigint);
|
|
181
|
+
if (value->kind != SCR_DYN_NUM) {
|
|
182
|
+
scr_dyn_arg_type_fail(name, "of type number", value);
|
|
183
|
+
return fallback;
|
|
184
|
+
}
|
|
185
|
+
return value->v.num;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static double scr_fs_cb_option_number(const ScrDyn *options, const char *name, double fallback) {
|
|
189
|
+
ScrDyn *value = scr_fs_cb_option(options, name);
|
|
190
|
+
if (!value) return fallback;
|
|
191
|
+
double number = scr_fs_cb_number(value, name, fallback);
|
|
192
|
+
scr_dyn_release(value);
|
|
193
|
+
return number;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static bool scr_fs_cb_option_bool(const ScrDyn *options, const char *name) {
|
|
197
|
+
ScrDyn *value = scr_fs_cb_option(options, name);
|
|
198
|
+
bool answer = value && scr_dyn_truthy(value);
|
|
199
|
+
scr_dyn_release(value);
|
|
200
|
+
return answer;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static bool scr_fs_cb_refuse_option(const ScrDyn *options, const char *name) {
|
|
204
|
+
ScrDyn *value = scr_fs_cb_option(options, name);
|
|
205
|
+
bool present = value && value->kind != SCR_DYN_UNDEF && value->kind != SCR_DYN_NULL;
|
|
206
|
+
scr_dyn_release(value);
|
|
207
|
+
if (present) {
|
|
208
|
+
char message[160];
|
|
209
|
+
int length = snprintf(message, sizeof message, "Filesystem callback option '%s' has no native lowering", name);
|
|
210
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, (size_t)length, "SC2020");
|
|
211
|
+
}
|
|
212
|
+
return present;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static bool scr_fs_cb_signal(const ScrDyn *options) {
|
|
216
|
+
ScrDyn *signal = scr_fs_cb_option(options, "signal");
|
|
217
|
+
if (!signal) return false;
|
|
218
|
+
if (scr_fs_dyn_absent(signal)) { scr_dyn_release(signal); return true; }
|
|
219
|
+
if (signal->kind != SCR_DYN_HANDLE || signal->v.handle.tag != SCR_DYNH_ABORT_SIGNAL) {
|
|
220
|
+
scr_dyn_arg_type_fail("options.signal", "an instance of AbortSignal", signal);
|
|
221
|
+
scr_dyn_release(signal);
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
ScrStr *key = scr_str_new("aborted", 7);
|
|
225
|
+
ScrDyn *aborted = scr_dyn_handle_key_get(signal, key);
|
|
226
|
+
scr_str_release(key);
|
|
227
|
+
bool cancelled = aborted && scr_dyn_truthy(aborted);
|
|
228
|
+
scr_dyn_release(aborted); scr_dyn_release(signal);
|
|
229
|
+
if (cancelled) {
|
|
230
|
+
static const char message[] = "The operation was aborted";
|
|
231
|
+
ScrStr *text = scr_str_new(message, sizeof message - 1);
|
|
232
|
+
ScrError *error = scr_error_new(SCR_ERR_ERROR, text);
|
|
233
|
+
scr_str_release(text);
|
|
234
|
+
scr_str_release(error->name);
|
|
235
|
+
error->name = scr_str_new("AbortError", 10);
|
|
236
|
+
error->name_present = true;
|
|
237
|
+
scr_error_set_code(error, "ABORT_ERR");
|
|
238
|
+
scr_throw_obj(error, scr_error_retain_v, scr_error_release_v, scr_error_trace_arg());
|
|
239
|
+
}
|
|
240
|
+
return !scr_exc_pending();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static double scr_fs_cb_open(const ScrStr *path, const ScrDyn *flag, double mode, const char *fallback) {
|
|
244
|
+
const char *f = flag->kind == SCR_DYN_UNDEF ? fallback : flag->kind == SCR_DYN_STR ? flag->v.str->data : NULL;
|
|
245
|
+
if (!f) {
|
|
246
|
+
static const char message[] = "Runtime numeric filesystem flags have no portable native lowering";
|
|
247
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, sizeof message - 1, "SC2020");
|
|
248
|
+
return -1;
|
|
249
|
+
}
|
|
250
|
+
int bits;
|
|
251
|
+
if (!strcmp(f, "r")) bits = O_RDONLY;
|
|
252
|
+
else if (!strcmp(f, "r+")) bits = O_RDWR;
|
|
253
|
+
else if (!strcmp(f, "rs") || !strcmp(f, "sr")) bits = O_RDONLY | O_SYNC;
|
|
254
|
+
else if (!strcmp(f, "rs+") || !strcmp(f, "sr+")) bits = O_RDWR | O_SYNC;
|
|
255
|
+
else if (!strcmp(f, "w")) bits = O_WRONLY | O_CREAT | O_TRUNC;
|
|
256
|
+
else if (!strcmp(f, "w+")) bits = O_RDWR | O_CREAT | O_TRUNC;
|
|
257
|
+
else if (!strcmp(f, "wx") || !strcmp(f, "xw")) bits = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL;
|
|
258
|
+
else if (!strcmp(f, "wx+") || !strcmp(f, "xw+")) bits = O_RDWR | O_CREAT | O_TRUNC | O_EXCL;
|
|
259
|
+
else if (!strcmp(f, "a")) bits = O_WRONLY | O_CREAT | O_APPEND;
|
|
260
|
+
else if (!strcmp(f, "a+")) bits = O_RDWR | O_CREAT | O_APPEND;
|
|
261
|
+
else if (!strcmp(f, "ax") || !strcmp(f, "xa")) bits = O_WRONLY | O_CREAT | O_APPEND | O_EXCL;
|
|
262
|
+
else if (!strcmp(f, "ax+") || !strcmp(f, "xa+")) bits = O_RDWR | O_CREAT | O_APPEND | O_EXCL;
|
|
263
|
+
else if (!strcmp(f, "as") || !strcmp(f, "sa")) bits = O_WRONLY | O_CREAT | O_APPEND | O_SYNC;
|
|
264
|
+
else if (!strcmp(f, "as+") || !strcmp(f, "sa+")) bits = O_RDWR | O_CREAT | O_APPEND | O_SYNC;
|
|
265
|
+
else {
|
|
266
|
+
char message[160];
|
|
267
|
+
int length = snprintf(message, sizeof message, "The argument 'flags' is invalid. Received '%s'", f);
|
|
268
|
+
scr_throw_error_msg_code(SCR_ERR_TYPE, message, (size_t)length, "ERR_INVALID_ARG_VALUE");
|
|
269
|
+
return -1;
|
|
270
|
+
}
|
|
271
|
+
if (scr_exc_pending()) return -1;
|
|
272
|
+
int fd = open(path->data, bits, (mode_t)mode);
|
|
273
|
+
if (fd < 0) scr_fs_throw(errno, "open", path);
|
|
274
|
+
return fd;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
static ScrStr *scr_fs_cb_path(const ScrDyn *value, const char *name) {
|
|
278
|
+
if (!scr_fs_path_chk(value, name)) return NULL;
|
|
279
|
+
ScrStr *path = value->kind == SCR_DYN_STR ? scr_str_retain(value->v.str)
|
|
280
|
+
: scr_str_new((const char *)value->v.bytes->data, value->v.bytes->len);
|
|
281
|
+
if (memchr(path->data, 0, path->len)) {
|
|
282
|
+
scr_dyn_arg_value_fail(name, "must be a string, Uint8Array, or URL without null bytes", value);
|
|
283
|
+
scr_str_release(path);
|
|
284
|
+
return NULL;
|
|
285
|
+
}
|
|
286
|
+
return path;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
static ScrDyn *scr_fs_cb_string(ScrStr *text) {
|
|
290
|
+
if (!text) return NULL;
|
|
291
|
+
ScrDyn *value = scr_dyn_new_str(text);
|
|
292
|
+
scr_str_release(text);
|
|
293
|
+
return value;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
static ScrStr *scr_fs_cb_join(const ScrStr *directory, const char *name) {
|
|
297
|
+
ScrStr *suffix = scr_str_new("/", 1);
|
|
298
|
+
ScrStr *base = scr_str_concat((ScrStr *)directory, suffix);
|
|
299
|
+
scr_str_release(suffix);
|
|
300
|
+
suffix = scr_str_new(name, strlen(name));
|
|
301
|
+
ScrStr *path = scr_str_concat(base, suffix);
|
|
302
|
+
scr_str_release(base); scr_str_release(suffix);
|
|
303
|
+
return path;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
static void scr_fs_cb_copy(const ScrStr *source, const ScrStr *destination, bool recursive, bool force, bool preserve) {
|
|
307
|
+
struct stat status;
|
|
308
|
+
if (
|
|
309
|
+
#ifdef _WIN32
|
|
310
|
+
stat(source->data, &status)
|
|
311
|
+
#else
|
|
312
|
+
lstat(source->data, &status)
|
|
313
|
+
#endif
|
|
314
|
+
< 0) { scr_fs_throw(errno, "stat", source); return; }
|
|
315
|
+
#ifndef _WIN32
|
|
316
|
+
if (S_ISLNK(status.st_mode)) {
|
|
317
|
+
const char *message = "Symbolic-link cp entries have no native lowering";
|
|
318
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, strlen(message), "SC2020");
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
#endif
|
|
322
|
+
if (S_ISDIR(status.st_mode)) {
|
|
323
|
+
if (!recursive) { scr_fs_throw(EISDIR, "cp", source); return; }
|
|
324
|
+
scr_fs_mkdir_recursive_mode((ScrStr *)destination, status.st_mode & 0777);
|
|
325
|
+
if (scr_exc_pending()) return;
|
|
326
|
+
DIR *directory = opendir(source->data);
|
|
327
|
+
if (!directory) { scr_fs_throw(errno, "opendir", source); return; }
|
|
328
|
+
struct dirent *entry;
|
|
329
|
+
while (!scr_exc_pending() && (entry = readdir(directory))) {
|
|
330
|
+
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) continue;
|
|
331
|
+
ScrStr *from = scr_fs_cb_join(source, entry->d_name), *to = scr_fs_cb_join(destination, entry->d_name);
|
|
332
|
+
scr_fs_cb_copy(from, to, true, force, preserve);
|
|
333
|
+
scr_str_release(from); scr_str_release(to);
|
|
334
|
+
}
|
|
335
|
+
closedir(directory);
|
|
336
|
+
} else {
|
|
337
|
+
if (!force && scr_fs_exists((ScrStr *)destination)) return;
|
|
338
|
+
scr_fs_copyfile((ScrStr *)source, (ScrStr *)destination);
|
|
339
|
+
}
|
|
340
|
+
if (preserve && !scr_exc_pending()) {
|
|
341
|
+
struct utimbuf times = { status.st_atime, status.st_mtime };
|
|
342
|
+
if (utime(destination->data, ×) < 0) scr_fs_throw(errno, "utime", destination);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
static ScrDyn *scr_fs_cb_stat_test(ScrClosure *closure, ScrDyn *const *args, size_t argc) {
|
|
347
|
+
(void)args; (void)argc;
|
|
348
|
+
return scr_dyn_new_bool(scr_box_get_bool(closure->caps[0]));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
static void scr_fs_cb_stat_method(ScrDyn *object, const char *name, bool answer) {
|
|
352
|
+
ScrClosure *closure = scr_closure_new(NULL, 1);
|
|
353
|
+
closure->caps[0] = scr_box_new(SCR_BOX_BOOL);
|
|
354
|
+
scr_box_set_bool(closure->caps[0], answer);
|
|
355
|
+
scr_dyn_obj_set(object, name, strlen(name), scr_dyn_new_func(closure, scr_fs_cb_stat_test, 0, "native:fs.Stats", name));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
static void scr_fs_cb_stat_number(ScrDyn *object, const char *name, int64_t number, bool bigint) {
|
|
359
|
+
ScrDyn *value;
|
|
360
|
+
if (bigint) {
|
|
361
|
+
ScrBigInt *integer = scr_bigint_from_i64(number);
|
|
362
|
+
value = scr_dyn_new_bigint(integer);
|
|
363
|
+
scr_bigint_release(integer);
|
|
364
|
+
} else value = scr_dyn_new_num((double)number);
|
|
365
|
+
scr_dyn_obj_set(object, name, strlen(name), value);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static void scr_fs_cb_stat_date(ScrDyn *object, const char *name, double milliseconds) {
|
|
369
|
+
ScrDyn *arguments = scr_dyn_new_arr();
|
|
370
|
+
scr_dyn_arr_push(arguments, scr_dyn_new_num(milliseconds));
|
|
371
|
+
ScrDyn *date = scr_dyn_native_date_new(arguments);
|
|
372
|
+
scr_dyn_release(arguments);
|
|
373
|
+
if (date) scr_dyn_obj_set(object, name, strlen(name), date);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static ScrDyn *scr_fs_cb_stats(const ScrStr *path, double fd, const ScrDyn *options, bool nofollow) {
|
|
377
|
+
struct stat status;
|
|
378
|
+
#ifdef _WIN32
|
|
379
|
+
(void)nofollow;
|
|
380
|
+
int rc = path ? stat(path->data, &status) : fstat((int)fd, &status);
|
|
381
|
+
#else
|
|
382
|
+
int rc = path ? (nofollow ? lstat(path->data, &status) : stat(path->data, &status)) : fstat((int)fd, &status);
|
|
383
|
+
#endif
|
|
384
|
+
if (rc < 0) { scr_fs_throw(errno, path ? (nofollow ? "lstat" : "stat") : "fstat", path); return NULL; }
|
|
385
|
+
bool bigint = scr_fs_cb_option_bool(options, "bigint");
|
|
386
|
+
ScrDyn *object = scr_dyn_new_obj();
|
|
387
|
+
#define SCR_FS_STAT_FIELD(field) scr_fs_cb_stat_number(object, #field, (int64_t)status.st_##field, bigint)
|
|
388
|
+
SCR_FS_STAT_FIELD(dev); SCR_FS_STAT_FIELD(ino); SCR_FS_STAT_FIELD(mode); SCR_FS_STAT_FIELD(nlink);
|
|
389
|
+
SCR_FS_STAT_FIELD(uid); SCR_FS_STAT_FIELD(gid); SCR_FS_STAT_FIELD(rdev); SCR_FS_STAT_FIELD(size);
|
|
390
|
+
#ifndef _WIN32
|
|
391
|
+
SCR_FS_STAT_FIELD(blksize); SCR_FS_STAT_FIELD(blocks);
|
|
392
|
+
#endif
|
|
393
|
+
#undef SCR_FS_STAT_FIELD
|
|
394
|
+
double atime = (double)status.st_atime * 1000, mtime = (double)status.st_mtime * 1000, ctime = (double)status.st_ctime * 1000;
|
|
395
|
+
double birthtime = 0;
|
|
396
|
+
#ifdef __APPLE__
|
|
397
|
+
atime += status.st_atimespec.tv_nsec / 1000000.0; mtime += status.st_mtimespec.tv_nsec / 1000000.0;
|
|
398
|
+
ctime += status.st_ctimespec.tv_nsec / 1000000.0;
|
|
399
|
+
birthtime = (double)status.st_birthtimespec.tv_sec * 1000 + status.st_birthtimespec.tv_nsec / 1000000.0;
|
|
400
|
+
#elif !defined(_WIN32) && !defined(__wasi__)
|
|
401
|
+
atime += status.st_atim.tv_nsec / 1000000.0; mtime += status.st_mtim.tv_nsec / 1000000.0;
|
|
402
|
+
ctime += status.st_ctim.tv_nsec / 1000000.0;
|
|
403
|
+
#endif
|
|
404
|
+
scr_fs_cb_stat_date(object, "atime", atime); scr_fs_cb_stat_date(object, "mtime", mtime);
|
|
405
|
+
scr_fs_cb_stat_date(object, "ctime", ctime); scr_fs_cb_stat_date(object, "birthtime", birthtime);
|
|
406
|
+
if (bigint) {
|
|
407
|
+
scr_fs_cb_stat_number(object, "atimeMs", (int64_t)atime, true);
|
|
408
|
+
scr_fs_cb_stat_number(object, "mtimeMs", (int64_t)mtime, true);
|
|
409
|
+
scr_fs_cb_stat_number(object, "ctimeMs", (int64_t)ctime, true);
|
|
410
|
+
scr_fs_cb_stat_number(object, "birthtimeMs", (int64_t)birthtime, true);
|
|
411
|
+
} else {
|
|
412
|
+
scr_dyn_obj_set(object, "atimeMs", 7, scr_dyn_new_num(atime));
|
|
413
|
+
scr_dyn_obj_set(object, "mtimeMs", 7, scr_dyn_new_num(mtime));
|
|
414
|
+
scr_dyn_obj_set(object, "ctimeMs", 7, scr_dyn_new_num(ctime));
|
|
415
|
+
scr_dyn_obj_set(object, "birthtimeMs", 11, scr_dyn_new_num(birthtime));
|
|
416
|
+
}
|
|
417
|
+
scr_fs_cb_stat_method(object, "isFile", S_ISREG(status.st_mode));
|
|
418
|
+
scr_fs_cb_stat_method(object, "isDirectory", S_ISDIR(status.st_mode));
|
|
419
|
+
#ifndef _WIN32
|
|
420
|
+
scr_fs_cb_stat_method(object, "isSymbolicLink", S_ISLNK(status.st_mode));
|
|
421
|
+
scr_fs_cb_stat_method(object, "isBlockDevice", S_ISBLK(status.st_mode));
|
|
422
|
+
scr_fs_cb_stat_method(object, "isCharacterDevice", S_ISCHR(status.st_mode));
|
|
423
|
+
scr_fs_cb_stat_method(object, "isFIFO", S_ISFIFO(status.st_mode));
|
|
424
|
+
scr_fs_cb_stat_method(object, "isSocket", S_ISSOCK(status.st_mode));
|
|
425
|
+
#else
|
|
426
|
+
scr_fs_cb_stat_method(object, "isSymbolicLink", false);
|
|
427
|
+
scr_fs_cb_stat_method(object, "isBlockDevice", false);
|
|
428
|
+
scr_fs_cb_stat_method(object, "isCharacterDevice", S_ISCHR(status.st_mode));
|
|
429
|
+
scr_fs_cb_stat_method(object, "isFIFO", false); scr_fs_cb_stat_method(object, "isSocket", false);
|
|
430
|
+
#endif
|
|
431
|
+
return object;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
#ifndef SCR_LIB
|
|
435
|
+
static void scr_fs_cb_fire(ScrClosure *closure) {
|
|
436
|
+
ScrDyn *callback = scr_box_get_ref(closure->caps[0]);
|
|
437
|
+
ScrDyn *arguments = scr_box_get_ref(closure->caps[1]);
|
|
438
|
+
ScrDyn *result = scr_dyn_apply(callback, arguments, "the filesystem callback");
|
|
439
|
+
scr_dyn_release(result); scr_dyn_release(callback); scr_dyn_release(arguments);
|
|
440
|
+
}
|
|
441
|
+
#endif
|
|
442
|
+
|
|
443
|
+
static void scr_fs_cb_schedule(const ScrDyn *callback, ScrDyn *result, const ScrDyn *buffer) {
|
|
444
|
+
ScrDyn *arguments = scr_dyn_new_arr();
|
|
445
|
+
if (scr_exc_pending()) {
|
|
446
|
+
ScrCaught *caught = scr_exc_take();
|
|
447
|
+
ScrDyn *error = scr_caught_to_dyn(caught);
|
|
448
|
+
scr_caught_release(caught);
|
|
449
|
+
scr_dyn_arr_push(arguments, error);
|
|
450
|
+
scr_dyn_release(result);
|
|
451
|
+
} else {
|
|
452
|
+
scr_dyn_arr_push(arguments, scr_dyn_new_null());
|
|
453
|
+
if (result) scr_dyn_arr_push(arguments, result);
|
|
454
|
+
if (buffer) scr_dyn_arr_push(arguments, scr_dyn_retain((ScrDyn *)buffer));
|
|
455
|
+
}
|
|
456
|
+
#ifndef SCR_LIB
|
|
457
|
+
ScrClosure *closure = scr_closure_new((void *)scr_fs_cb_fire, 2);
|
|
458
|
+
closure->caps[0] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
459
|
+
closure->caps[1] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, scr_dyn_trace_v);
|
|
460
|
+
scr_box_set_ref(closure->caps[0], scr_dyn_retain((ScrDyn *)callback));
|
|
461
|
+
scr_box_set_ref(closure->caps[1], arguments);
|
|
462
|
+
scr_set_timeout(closure, 0);
|
|
463
|
+
#else
|
|
464
|
+
(void)callback;
|
|
465
|
+
scr_dyn_release(arguments);
|
|
466
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, "Filesystem callbacks require an executable event loop", 52, "SC4005");
|
|
467
|
+
#endif
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
static bool scr_fs_read_validate(const ScrDyn *, const ScrDyn *, const ScrDyn *, const ScrDyn *, const ScrDyn *);
|
|
471
|
+
static bool scr_fs_encoding_chk(const ScrDyn *);
|
|
472
|
+
|
|
473
|
+
static ScrDyn *scr_fs_cb_invoke(ScrStr *member, ScrDyn *const *args, size_t argc) {
|
|
474
|
+
const char *op = member->data;
|
|
475
|
+
bool fileCallback = !strcmp(op, "readFile") || !strcmp(op, "mkdtemp");
|
|
476
|
+
const ScrDyn *callback = argc >= (fileCallback ? 2u : 1u) ? args[argc - 1] : scr_dyn_undefined();
|
|
477
|
+
if (!scr_fs_cb_chk(callback, fileCallback ? "cb" : "callback")) return NULL;
|
|
478
|
+
size_t count = argc - 1;
|
|
479
|
+
#define ARG(index) scr_fs_cb_arg(args, count, index)
|
|
480
|
+
if (!strcmp(op, "readFile") && !scr_fs_encoding_chk(ARG(1))) return NULL;
|
|
481
|
+
if (!strcmp(op, "read") && count >= 4 && !scr_fs_read_validate(ARG(0), ARG(1), ARG(2), ARG(3), ARG(4))) return NULL;
|
|
482
|
+
bool descriptor = !strcmp(op, "close") || !strcmp(op, "fstat") || !strcmp(op, "ftruncate") || !strcmp(op, "fsync") || !strcmp(op, "read") || !strcmp(op, "write");
|
|
483
|
+
ScrStr *path = descriptor ? NULL : scr_fs_cb_path(ARG(0), !strcmp(op, "mkdtemp") ? "prefix" : "path");
|
|
484
|
+
if (!descriptor && !path) return NULL;
|
|
485
|
+
double fd = descriptor ? scr_fs_cb_number(ARG(0), "fd", -1) : -1;
|
|
486
|
+
if (scr_exc_pending()) { scr_str_release(path); return NULL; }
|
|
487
|
+
ScrDyn *result = NULL;
|
|
488
|
+
const ScrDyn *buffer = NULL;
|
|
489
|
+
if (!strcmp(op, "readFile")) {
|
|
490
|
+
const ScrDyn *options = ARG(1);
|
|
491
|
+
if (options->kind != SCR_DYN_STR && (!scr_fs_cb_signal(options) || scr_fs_cb_refuse_option(options, "flag"))) goto done;
|
|
492
|
+
ScrDyn *encoding = options->kind == SCR_DYN_STR ? scr_dyn_retain((ScrDyn *)options) : scr_fs_cb_option(options, "encoding");
|
|
493
|
+
if (encoding) result = scr_fs_read_file_sync_dyn(path, encoding);
|
|
494
|
+
scr_dyn_release(encoding);
|
|
495
|
+
} else if (!strcmp(op, "writeFile") || !strcmp(op, "appendFile")) {
|
|
496
|
+
const ScrDyn *options = ARG(2);
|
|
497
|
+
if (options->kind != SCR_DYN_STR && !scr_fs_cb_signal(options)) goto done;
|
|
498
|
+
ScrDyn *encoding = options->kind == SCR_DYN_STR ? scr_dyn_retain((ScrDyn *)options) : scr_fs_cb_option(options, "encoding");
|
|
499
|
+
ScrStr *codec = encoding && encoding->kind == SCR_DYN_STR ? scr_str_retain(encoding->v.str) : scr_str_new("utf8", 4);
|
|
500
|
+
ScrBytes *data = encoding ? scr_buffer_from_dyn(ARG(1), codec) : NULL;
|
|
501
|
+
scr_str_release(codec);
|
|
502
|
+
scr_dyn_release(encoding);
|
|
503
|
+
if (data) {
|
|
504
|
+
ScrDyn *flag = scr_fs_cb_option(options->kind == SCR_DYN_STR ? scr_dyn_undefined() : options, "flag");
|
|
505
|
+
double mode = scr_fs_cb_option_number(options->kind == SCR_DYN_STR ? scr_dyn_undefined() : options, "mode", 0666);
|
|
506
|
+
double fd = flag ? scr_fs_cb_open(path, flag, mode, !strcmp(op, "appendFile") ? "a" : "w") : -1;
|
|
507
|
+
scr_dyn_release(flag);
|
|
508
|
+
if (fd >= 0) {
|
|
509
|
+
size_t offset = 0;
|
|
510
|
+
while (offset < data->len && !scr_exc_pending()) {
|
|
511
|
+
double written = scr_fs_write_sync(fd, data, (double)offset, (double)(data->len - offset), -1);
|
|
512
|
+
if (written <= 0) break;
|
|
513
|
+
offset += (size_t)written;
|
|
514
|
+
}
|
|
515
|
+
int saved = errno;
|
|
516
|
+
close((int)fd);
|
|
517
|
+
errno = saved;
|
|
518
|
+
}
|
|
519
|
+
scr_bytes_release(data);
|
|
520
|
+
}
|
|
521
|
+
} else if (!strcmp(op, "access")) scr_fs_access(path, scr_fs_cb_number(ARG(1), "mode", 0));
|
|
522
|
+
else if (!strcmp(op, "mkdir")) {
|
|
523
|
+
const ScrDyn *options = ARG(1);
|
|
524
|
+
double mode = options->kind == SCR_DYN_NUM ? options->v.num : scr_fs_cb_option_number(options, "mode", 0777);
|
|
525
|
+
if (scr_fs_cb_option_bool(options->kind == SCR_DYN_NUM ? scr_dyn_undefined() : options, "recursive")) scr_fs_mkdir_recursive_mode(path, mode);
|
|
526
|
+
else scr_fs_mkdir_mode(path, mode);
|
|
527
|
+
} else if (!strcmp(op, "mkdtemp")) result = scr_fs_cb_string(scr_fs_mkdtemp(path));
|
|
528
|
+
else if (!strcmp(op, "rm")) scr_fs_rm_opts_retry(path, scr_fs_cb_option_bool(ARG(1), "recursive"), scr_fs_cb_option_bool(ARG(1), "force"), scr_fs_cb_option_number(ARG(1), "maxRetries", 0), scr_fs_cb_option_number(ARG(1), "retryDelay", 100));
|
|
529
|
+
else if (!strcmp(op, "rmdir")) scr_fs_rmdir(path);
|
|
530
|
+
else if (!strcmp(op, "unlink")) scr_fs_unlink(path);
|
|
531
|
+
else if (!strcmp(op, "chmod")) scr_fs_chmod(path, scr_fs_cb_number(ARG(1), "mode", 0));
|
|
532
|
+
else if (!strcmp(op, "chown")) scr_fs_chown(path, scr_fs_cb_number(ARG(1), "uid", 0), scr_fs_cb_number(ARG(2), "gid", 0));
|
|
533
|
+
else if (!strcmp(op, "realpath")) result = scr_fs_cb_string(scr_fs_realpath(path));
|
|
534
|
+
else if (!strcmp(op, "stat") || !strcmp(op, "lstat")) result = scr_fs_cb_stats(path, -1, ARG(1), !strcmp(op, "lstat"));
|
|
535
|
+
else if (!strcmp(op, "fstat")) result = scr_fs_cb_stats(NULL, fd, ARG(1), false);
|
|
536
|
+
else if (!strcmp(op, "close")) scr_fs_close(fd);
|
|
537
|
+
else if (!strcmp(op, "fsync")) scr_fs_fsync(fd);
|
|
538
|
+
else if (!strcmp(op, "open")) {
|
|
539
|
+
double opened = scr_fs_cb_open(path, ARG(1), scr_fs_cb_number(ARG(2), "mode", 0666), "r");
|
|
540
|
+
if (!scr_exc_pending()) result = scr_dyn_new_num(opened);
|
|
541
|
+
} else if (!strcmp(op, "cp")) {
|
|
542
|
+
if (scr_fs_cb_refuse_option(ARG(2), "filter") || scr_fs_cb_refuse_option(ARG(2), "dereference") || scr_fs_cb_refuse_option(ARG(2), "verbatimSymlinks") || scr_fs_cb_refuse_option(ARG(2), "errorOnExist") || scr_fs_cb_refuse_option(ARG(2), "mode")) goto done;
|
|
543
|
+
ScrStr *destination = scr_fs_cb_path(ARG(1), "dest");
|
|
544
|
+
if (destination) {
|
|
545
|
+
ScrDyn *force = scr_fs_cb_option(ARG(2), "force");
|
|
546
|
+
scr_fs_cb_copy(path, destination, scr_fs_cb_option_bool(ARG(2), "recursive"),
|
|
547
|
+
force && (force->kind == SCR_DYN_UNDEF || scr_dyn_truthy(force)), scr_fs_cb_option_bool(ARG(2), "preserveTimestamps"));
|
|
548
|
+
scr_dyn_release(force); scr_str_release(destination);
|
|
549
|
+
}
|
|
550
|
+
} else if (!strcmp(op, "glob")) {
|
|
551
|
+
#if SCR_FS_HAS_GLOB
|
|
552
|
+
if (strstr(path->data, "**") || scr_fs_cb_option_bool(ARG(1), "withFileTypes")) {
|
|
553
|
+
const char *message = "Recursive glob patterns and Dirent results have no native lowering";
|
|
554
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, strlen(message), "SC2020");
|
|
555
|
+
goto done;
|
|
556
|
+
}
|
|
557
|
+
ScrDyn *cwd = scr_fs_cb_option(ARG(1), "cwd");
|
|
558
|
+
ScrDyn *exclude = scr_fs_cb_option(ARG(1), "exclude");
|
|
559
|
+
if (exclude && exclude->kind != SCR_DYN_UNDEF) {
|
|
560
|
+
const char *message = "fs.glob exclude options have no native lowering";
|
|
561
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, strlen(message), "SC2020");
|
|
562
|
+
} else {
|
|
563
|
+
ScrStr *pattern = cwd && cwd->kind == SCR_DYN_STR ? scr_fs_cb_join(cwd->v.str, path->data) : scr_str_retain(path);
|
|
564
|
+
glob_t matches = {0};
|
|
565
|
+
int rc = glob(pattern->data, 0, NULL, &matches);
|
|
566
|
+
if (rc && rc != GLOB_NOMATCH) scr_fs_throw(rc == GLOB_NOSPACE ? ENOMEM : EIO, "glob", path);
|
|
567
|
+
else {
|
|
568
|
+
result = scr_dyn_new_arr();
|
|
569
|
+
size_t prefix = cwd && cwd->kind == SCR_DYN_STR ? cwd->v.str->len + 1 : 0;
|
|
570
|
+
for (size_t i = 0; i < matches.gl_pathc; i++) {
|
|
571
|
+
const char *name = matches.gl_pathv[i] + prefix;
|
|
572
|
+
scr_dyn_arr_push(result, scr_fs_cb_string(scr_str_new(name, strlen(name))));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
globfree(&matches); scr_str_release(pattern);
|
|
576
|
+
}
|
|
577
|
+
scr_dyn_release(cwd); scr_dyn_release(exclude);
|
|
578
|
+
#else
|
|
579
|
+
scr_fs_throw(ENOSYS, "glob", path);
|
|
580
|
+
#endif
|
|
581
|
+
} else if (!strcmp(op, "read") || !strcmp(op, "write")) {
|
|
582
|
+
bool readOp = !strcmp(op, "read");
|
|
583
|
+
const ScrDyn *options = ARG(1);
|
|
584
|
+
ScrDyn *ownedBuffer = NULL;
|
|
585
|
+
if (readOp && !scr_dyn_bytes_is(options, SCR_BYTES_U8)) { ownedBuffer = scr_fs_cb_option(options, "buffer"); buffer = ownedBuffer; }
|
|
586
|
+
else buffer = options;
|
|
587
|
+
ScrBytes *bytes = buffer && buffer->kind == SCR_DYN_BYTES ? scr_dyn_bytes_unbox(buffer) : NULL;
|
|
588
|
+
if (!bytes) scr_dyn_arg_type_fail("buffer", "an instance of Buffer, TypedArray, or DataView", buffer ? buffer : scr_dyn_undefined());
|
|
589
|
+
else {
|
|
590
|
+
double offset = ownedBuffer ? scr_fs_cb_option_number(options, "offset", 0) : scr_fs_cb_number(ARG(2), "offset", 0);
|
|
591
|
+
double length = ownedBuffer ? scr_fs_cb_option_number(options, "length", bytes->len - offset) : scr_fs_cb_number(ARG(3), "length", bytes->len - offset);
|
|
592
|
+
double position = ownedBuffer ? scr_fs_cb_option_number(options, "position", -1) : scr_fs_cb_number(ARG(4), "position", -1);
|
|
593
|
+
if (!scr_exc_pending()) result = scr_dyn_new_num(readOp ? scr_fs_read_sync(fd, bytes, offset, length, position) : scr_fs_write_sync(fd, bytes, offset, length, position));
|
|
594
|
+
}
|
|
595
|
+
scr_bytes_release(bytes);
|
|
596
|
+
/* The completion retains the original buffer, including options.buffer. */
|
|
597
|
+
if (ownedBuffer) {
|
|
598
|
+
scr_fs_cb_schedule(callback, result, ownedBuffer);
|
|
599
|
+
scr_dyn_release(ownedBuffer); scr_str_release(path);
|
|
600
|
+
return scr_dyn_retain(scr_dyn_undefined());
|
|
601
|
+
}
|
|
602
|
+
} else if (!strcmp(op, "copyFile") || !strcmp(op, "rename") || !strcmp(op, "link") || !strcmp(op, "symlink")) {
|
|
603
|
+
ScrStr *destination = scr_fs_cb_path(ARG(1), "dest");
|
|
604
|
+
if (destination) {
|
|
605
|
+
if (!strcmp(op, "rename")) scr_fs_rename(path, destination);
|
|
606
|
+
else if (!strcmp(op, "link")) scr_fs_link(path, destination);
|
|
607
|
+
else if (!strcmp(op, "copyFile")) {
|
|
608
|
+
double flags = scr_fs_cb_number(ARG(2), "mode", 0);
|
|
609
|
+
if (flags == 1 && scr_fs_exists(destination)) scr_fs_throw(EEXIST, "copyfile", destination);
|
|
610
|
+
else if (flags != 0 && flags != 1) {
|
|
611
|
+
static const char message[] = "fs.copyFile clone flags have no native lowering";
|
|
612
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, sizeof message - 1, "SC2020");
|
|
613
|
+
} else if (!scr_exc_pending()) scr_fs_copyfile(path, destination);
|
|
614
|
+
}
|
|
615
|
+
else {
|
|
616
|
+
#if !defined(_WIN32)
|
|
617
|
+
if (symlink(path->data, destination->data) < 0) scr_fs_throw(errno, "symlink", path);
|
|
618
|
+
#else
|
|
619
|
+
scr_fs_throw(ENOSYS, "symlink", path);
|
|
620
|
+
#endif
|
|
621
|
+
}
|
|
622
|
+
scr_str_release(destination);
|
|
623
|
+
}
|
|
624
|
+
} else if (!strcmp(op, "truncate") || !strcmp(op, "ftruncate")) {
|
|
625
|
+
double length = scr_fs_cb_number(ARG(1), "len", 0);
|
|
626
|
+
if (!scr_exc_pending()) {
|
|
627
|
+
int rc = descriptor ? ftruncate((int)fd, (off_t)length) : truncate(path->data, (off_t)length);
|
|
628
|
+
if (rc < 0) scr_fs_throw(errno, descriptor ? "ftruncate" : "truncate", path);
|
|
629
|
+
}
|
|
630
|
+
} else if (!strcmp(op, "readlink")) {
|
|
631
|
+
#ifndef _WIN32
|
|
632
|
+
size_t capacity = 256;
|
|
633
|
+
char *text = NULL;
|
|
634
|
+
for (;;) {
|
|
635
|
+
char *grown = realloc(text, capacity);
|
|
636
|
+
if (!grown) scr_bytes_io_oom();
|
|
637
|
+
text = grown;
|
|
638
|
+
ssize_t size = readlink(path->data, text, capacity);
|
|
639
|
+
if (size < 0) { scr_fs_throw(errno, "readlink", path); break; }
|
|
640
|
+
if ((size_t)size < capacity) { result = scr_fs_cb_string(scr_str_new(text, (size_t)size)); break; }
|
|
641
|
+
capacity *= 2;
|
|
642
|
+
}
|
|
643
|
+
free(text);
|
|
644
|
+
#else
|
|
645
|
+
scr_fs_throw(ENOSYS, "readlink", path);
|
|
646
|
+
#endif
|
|
647
|
+
} else if (!strcmp(op, "utimes")) {
|
|
648
|
+
double access = scr_fs_to_unix_timestamp(ARG(1)), modified = scr_fs_to_unix_timestamp(ARG(2));
|
|
649
|
+
#if !defined(_WIN32)
|
|
650
|
+
struct timespec times[2] = {
|
|
651
|
+
{ (time_t)floor(access), (long)((access - floor(access)) * 1000000000) },
|
|
652
|
+
{ (time_t)floor(modified), (long)((modified - floor(modified)) * 1000000000) },
|
|
653
|
+
};
|
|
654
|
+
if (!scr_exc_pending() && utimensat(AT_FDCWD, path->data, times, 0) < 0) scr_fs_throw(errno, "utime", path);
|
|
655
|
+
#else
|
|
656
|
+
struct utimbuf times = { (time_t)access, (time_t)modified };
|
|
657
|
+
if (!scr_exc_pending() && utime(path->data, ×) < 0) scr_fs_throw(errno, "utime", path);
|
|
658
|
+
#endif
|
|
659
|
+
} else if (!strcmp(op, "readdir")) {
|
|
660
|
+
if (scr_fs_cb_refuse_option(ARG(1), "encoding") || scr_fs_cb_option_bool(ARG(1), "withFileTypes") || scr_fs_cb_option_bool(ARG(1), "recursive")) {
|
|
661
|
+
if (!scr_exc_pending()) { const char *message = "Recursive readdir and Dirent results have no native lowering"; scr_throw_error_msg_code(SCR_ERR_ERROR, message, strlen(message), "SC2020"); }
|
|
662
|
+
goto done;
|
|
663
|
+
}
|
|
664
|
+
ScrArr *names = scr_fs_readdir(path);
|
|
665
|
+
if (names) {
|
|
666
|
+
result = scr_dyn_new_arr();
|
|
667
|
+
for (size_t i = 0; i < (size_t)scr_arr_len(names); i++) scr_dyn_arr_push(result, scr_fs_cb_string(scr_arr_get_ref(names, (double)i)));
|
|
668
|
+
scr_arr_release(names);
|
|
669
|
+
}
|
|
670
|
+
} else {
|
|
671
|
+
char message[160];
|
|
672
|
+
int length = snprintf(message, sizeof message, "Native filesystem callback fs.%s with these options has no lowering", op);
|
|
673
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, message, (size_t)length, "SC2020");
|
|
674
|
+
}
|
|
675
|
+
#undef ARG
|
|
676
|
+
done:
|
|
677
|
+
scr_str_release(path);
|
|
678
|
+
scr_fs_cb_schedule(callback, result, buffer);
|
|
679
|
+
return scr_dyn_retain(scr_dyn_undefined());
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
static ScrDyn *scr_fs_cb_value_call(ScrClosure *closure, ScrDyn *const *args, size_t argc) {
|
|
683
|
+
ScrStr *member = scr_box_get_ref(closure->caps[0]);
|
|
684
|
+
ScrDyn *result = scr_fs_cb_invoke(member, args, argc);
|
|
685
|
+
scr_str_release(member);
|
|
686
|
+
return result;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
ScrDyn *scr_fs_callback_value(ScrStr *member) {
|
|
690
|
+
ScrClosure *closure = scr_closure_new(NULL, 1);
|
|
691
|
+
closure->caps[0] = scr_box_new(SCR_BOX_STR);
|
|
692
|
+
scr_box_set_ref(closure->caps[0], scr_str_retain(member));
|
|
693
|
+
return scr_dyn_new_func(closure, scr_fs_cb_value_call, 0, "native:fs.callback", "filesystemCallback");
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
ScrDyn *scr_fs_callback_call(ScrStr *member, const ScrDyn *args) {
|
|
697
|
+
return scr_fs_cb_invoke(member, args->v.arr.items, args->v.arr.len);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/* ── crypto.randomBytes → a real Buffer ────────────────────────────────── */
|
|
701
|
+
|
|
702
|
+
ScrBytes *scr_crypto_random_bytes(double n) {
|
|
703
|
+
if (!(n >= 0 && n <= 2147483647)) {
|
|
704
|
+
char num[32];
|
|
705
|
+
size_t numlen = scr_f64_to_str(n, num);
|
|
706
|
+
char msg[128];
|
|
707
|
+
int mlen = snprintf(
|
|
708
|
+
msg, sizeof msg,
|
|
709
|
+
"The value of \"size\" is out of range. It must be >= 0 && <= 2147483647. Received %.*s",
|
|
710
|
+
(int)numlen, num);
|
|
711
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)mlen, "ERR_OUT_OF_RANGE");
|
|
712
|
+
return NULL;
|
|
713
|
+
}
|
|
714
|
+
ScrBytes *b = scr_bytes_new(SCR_BYTES_U8, n);
|
|
715
|
+
if (b->len > 0) arc4random_buf(b->data, b->len);
|
|
716
|
+
return b;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/* ── process.stdout/stderr.write(buf) ──────────────────────────────────── */
|
|
720
|
+
|
|
721
|
+
bool scr_process_stdout_write_bytes(const ScrBytes *b, const ScrStr *encoding) {
|
|
722
|
+
(void)encoding;
|
|
723
|
+
return scr_stdio_write(1, b->data, b->len * scr_bytes_elem_size(b->elem));
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
bool scr_process_stderr_write_bytes(const ScrBytes *b, const ScrStr *encoding) {
|
|
727
|
+
(void)encoding;
|
|
728
|
+
return scr_stdio_write(2, b->data, b->len * scr_bytes_elem_size(b->elem));
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/* Buffer.from over checked-native input. Strings use the existing codec;
|
|
732
|
+
* bytes, arrays and data-only array-like/Buffer-JSON objects always COPY.
|
|
733
|
+
* A dyn is not an arbitrary JS object: opaque references and custom input
|
|
734
|
+
* valueOf hooks keep a loud refusal rather than silently skipping hooks. */
|
|
735
|
+
static ScrBytes *scr_buffer_from_refusal(const char *detail) {
|
|
736
|
+
char msg[192];
|
|
737
|
+
int n = snprintf(msg, sizeof msg, "Buffer.from %s is not supported yet", detail);
|
|
738
|
+
scr_throw_error_msg(SCR_ERR_ERROR, msg, (size_t)n);
|
|
739
|
+
return NULL;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
static ScrBytes *scr_buffer_from_array_like(const ScrDyn *value, double length) {
|
|
743
|
+
if (!(length > 0)) return scr_bytes_new(SCR_BYTES_U8, 0);
|
|
744
|
+
if (!isfinite(length) || length >= 9007199254740991.0 || length >= (double)SIZE_MAX) {
|
|
745
|
+
static const char msg[] = "Array buffer allocation failed";
|
|
746
|
+
scr_throw_error_msg(SCR_ERR_RANGE, msg, sizeof msg - 1);
|
|
747
|
+
return NULL;
|
|
748
|
+
}
|
|
749
|
+
ScrBytes *out = scr_bytes_new(SCR_BYTES_U8, floor(length));
|
|
750
|
+
if (!out) return NULL;
|
|
751
|
+
for (size_t i = 0; i < out->len; i++) {
|
|
752
|
+
ScrDyn *item;
|
|
753
|
+
if (value->kind == SCR_DYN_ARR) {
|
|
754
|
+
item = i < value->v.arr.len ? value->v.arr.items[i] : NULL;
|
|
755
|
+
} else {
|
|
756
|
+
char key[32];
|
|
757
|
+
int n = snprintf(key, sizeof key, "%zu", i);
|
|
758
|
+
item = scr_dyn_obj_get(value, key, (size_t)n);
|
|
759
|
+
}
|
|
760
|
+
/* Coercion may run user code that removes or replaces this element. */
|
|
761
|
+
item = scr_dyn_retain(item ? item : scr_dyn_undefined());
|
|
762
|
+
double number;
|
|
763
|
+
bool ok = scr_dyn_number_coerce_js(item, &number);
|
|
764
|
+
scr_dyn_release(item);
|
|
765
|
+
if (!ok) {
|
|
766
|
+
scr_bytes_release(out);
|
|
767
|
+
return NULL;
|
|
768
|
+
}
|
|
769
|
+
out->data[i] = (uint8_t)scr_to_uint32(number);
|
|
770
|
+
}
|
|
771
|
+
return out;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
ScrBytes *scr_buffer_from_dyn(const ScrDyn *value, const ScrStr *encoding) {
|
|
775
|
+
if (value->kind == SCR_DYN_STR) return scr_bytes_from_str(value->v.str, encoding);
|
|
776
|
+
if (value->kind == SCR_DYN_BYTES) return scr_bytes_convert(SCR_BYTES_U8, value->v.bytes);
|
|
777
|
+
if (value->kind == SCR_DYN_ARR) {
|
|
778
|
+
return scr_buffer_from_array_like(value, (double)value->v.arr.len);
|
|
779
|
+
}
|
|
780
|
+
if (value->kind == SCR_DYN_OBJ) {
|
|
781
|
+
const ScrDyn *hook = scr_dyn_obj_get(value, "valueOf", 7);
|
|
782
|
+
if (hook && scr_dyn_truthy(hook)) {
|
|
783
|
+
return scr_buffer_from_refusal("with a custom valueOf");
|
|
784
|
+
}
|
|
785
|
+
const ScrDyn *length = scr_dyn_obj_get(value, "length", 6);
|
|
786
|
+
if (length && length->kind != SCR_DYN_UNDEF) {
|
|
787
|
+
return scr_buffer_from_array_like(value, length->kind == SCR_DYN_NUM ? length->v.num : 0);
|
|
788
|
+
}
|
|
789
|
+
const ScrDyn *type = scr_dyn_obj_get(value, "type", 4);
|
|
790
|
+
const ScrDyn *data = scr_dyn_obj_get(value, "data", 4);
|
|
791
|
+
if (type && type->kind == SCR_DYN_STR && type->v.str->len == 6 &&
|
|
792
|
+
memcmp(type->v.str->data, "Buffer", 6) == 0 && data && data->kind == SCR_DYN_ARR) {
|
|
793
|
+
/* Element coercion may mutate the parent and replace `data`. */
|
|
794
|
+
ScrDyn *held = scr_dyn_retain((ScrDyn *)data);
|
|
795
|
+
ScrBytes *out = scr_buffer_from_array_like(held, (double)held->v.arr.len);
|
|
796
|
+
scr_dyn_release(held);
|
|
797
|
+
return out;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if (value->kind == SCR_DYN_TYPED_REF || value->kind == SCR_DYN_HANDLE || value->kind == SCR_DYN_JSVAL) {
|
|
801
|
+
return scr_buffer_from_refusal("with an opaque reference");
|
|
802
|
+
}
|
|
803
|
+
char detail[64];
|
|
804
|
+
const char *received = scr_dyn_specific_type(value, detail, sizeof detail);
|
|
805
|
+
char msg[256];
|
|
806
|
+
int n = snprintf(msg, sizeof msg,
|
|
807
|
+
"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received %s",
|
|
808
|
+
received);
|
|
809
|
+
scr_throw_error_msg_code(SCR_ERR_TYPE, msg, (size_t)n, "ERR_INVALID_ARG_TYPE");
|
|
810
|
+
return NULL;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/* ── the checked-dynamic Buffer compare/equals validators ──────────────
|
|
814
|
+
* Node's argument ladders for buf.equals / buf.compare / Buffer.compare
|
|
815
|
+
* over dyn-boxed arguments (the invalid-input probes: string needles,
|
|
816
|
+
* '0' offsets, null/object range args). A well-typed dyn still computes
|
|
817
|
+
* the real answer — validation, not a constant fence. */
|
|
818
|
+
|
|
819
|
+
/* A bytes payload or the API's own ERR_INVALID_ARG_TYPE (borrowed). */
|
|
820
|
+
static ScrBytes *scr_bytes_chk_u8(const ScrDyn *d, const char *argname) {
|
|
821
|
+
if (!scr_dyn_bytes_is(d, SCR_BYTES_U8)) {
|
|
822
|
+
scr_dyn_arg_type_fail(argname, "an instance of Buffer or Uint8Array", d);
|
|
823
|
+
return NULL;
|
|
824
|
+
}
|
|
825
|
+
return d->v.bytes;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
double scr_buffer_compare_chk(const ScrDyn *a, const ScrDyn *b) {
|
|
829
|
+
ScrBytes *b1 = scr_bytes_chk_u8(a, "buf1");
|
|
830
|
+
if (!b1) return 0;
|
|
831
|
+
ScrBytes *b2 = scr_bytes_chk_u8(b, "buf2");
|
|
832
|
+
if (!b2) return 0;
|
|
833
|
+
return scr_bytes_compare(b1, b2, 0, 0, 0, 0, 0);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
bool scr_bytes_equals_chk(const ScrBytes *recv, const ScrDyn *other) {
|
|
837
|
+
ScrBytes *o = scr_bytes_chk_u8(other, "otherBuffer");
|
|
838
|
+
if (!o) return false;
|
|
839
|
+
return scr_bytes_equals(recv, o);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/* One offset slot: undefined takes the Node default, non-numbers throw
|
|
843
|
+
* ERR_INVALID_ARG_TYPE "of type number", numbers run validateOffset. */
|
|
844
|
+
static bool scr_bytes_chk_off(const ScrDyn *d, const char *name, double max,
|
|
845
|
+
double dflt, double *out) {
|
|
846
|
+
if (d->kind == SCR_DYN_UNDEF) {
|
|
847
|
+
*out = dflt;
|
|
848
|
+
return true;
|
|
849
|
+
}
|
|
850
|
+
if (d->kind != SCR_DYN_NUM) {
|
|
851
|
+
scr_dyn_arg_type_fail(name, "of type number", d);
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
*out = d->v.num;
|
|
855
|
+
return scr_bytes_validate_off(name, *out, max);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
double scr_bytes_compare_chk(const ScrBytes *src, const ScrDyn *target,
|
|
859
|
+
const ScrDyn *ts, const ScrDyn *te,
|
|
860
|
+
const ScrDyn *ss, const ScrDyn *se) {
|
|
861
|
+
ScrBytes *t = scr_bytes_chk_u8(target, "target");
|
|
862
|
+
if (!t) return 0;
|
|
863
|
+
double tsv, tev, ssv, sev;
|
|
864
|
+
if (!scr_bytes_chk_off(ts, "targetStart", 9007199254740991.0, 0, &tsv)) return 0;
|
|
865
|
+
if (!scr_bytes_chk_off(te, "targetEnd", (double)t->len, (double)t->len, &tev)) return 0;
|
|
866
|
+
if (!scr_bytes_chk_off(ss, "sourceStart", 9007199254740991.0, 0, &ssv)) return 0;
|
|
867
|
+
if (!scr_bytes_chk_off(se, "sourceEnd", (double)src->len, (double)src->len, &sev)) return 0;
|
|
868
|
+
/* Every slot validated or defaulted above; nargs 4 revalidates the
|
|
869
|
+
* now-known-good numbers (a no-op) and keeps one comparison core. */
|
|
870
|
+
return scr_bytes_compare(src, t, 4, tsv, tev, ssv, sev);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/* new Buffer(number, encoding) — the deprecated ctor's string arm with a
|
|
874
|
+
* non-string first argument: Node's exact ERR_INVALID_ARG_TYPE (the
|
|
875
|
+
* throwing path never fires DEP0005, so compiled silence matches). */
|
|
876
|
+
ScrBytes *scr_buffer_new_string_fail(const ScrDyn *got) {
|
|
877
|
+
scr_dyn_arg_type_fail("string", "of type string", got);
|
|
878
|
+
return NULL;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/* fs._toUnixTimestamp — the seconds coercion the utimes family runs on
|
|
882
|
+
* its time arguments (fs.js's toUnixTimestamp, underscore-exported):
|
|
883
|
+
* numeric STRINGS pass ToNumber's loose-equality gate (+time == time —
|
|
884
|
+
* whitespace-only strings answer 0), finite numbers pass (negatives
|
|
885
|
+
* answer now/1000, Node's "past times" shape), everything else throws
|
|
886
|
+
* Node's exact ERR_INVALID_ARG_TYPE. Borrowed; the throw is pending on
|
|
887
|
+
* the dummy 0 return. */
|
|
888
|
+
double scr_fs_to_unix_timestamp(const ScrDyn *t) {
|
|
889
|
+
if (t->kind == SCR_DYN_STR) {
|
|
890
|
+
double n = scr_string_to_number(t->v.str);
|
|
891
|
+
/* +time == time: NaN fails; every parsed number loosely equals its
|
|
892
|
+
* own source string by construction of ToNumber. */
|
|
893
|
+
if (n == n) return n;
|
|
894
|
+
}
|
|
895
|
+
if (t->kind == SCR_DYN_NUM && isfinite(t->v.num)) {
|
|
896
|
+
if (t->v.num < 0) {
|
|
897
|
+
struct timespec ts;
|
|
898
|
+
clock_gettime(CLOCK_REALTIME, &ts);
|
|
899
|
+
return ((double)ts.tv_sec * 1000.0 + (double)ts.tv_nsec / 1e6) / 1000.0;
|
|
900
|
+
}
|
|
901
|
+
return t->v.num;
|
|
902
|
+
}
|
|
903
|
+
scr_dyn_arg_type_fail("time", "an instance of Date or an Time in seconds", t);
|
|
904
|
+
return 0;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/* ── the fs argument-validation ladders (checked-dynamic lane) ─────────
|
|
908
|
+
* Each fs.*Chk libCall replicates its API's Node-order validation over
|
|
909
|
+
* dyn values and throws Node's exact typed errors; when every validation
|
|
910
|
+
* passes, the honest tail runs — the real operation where one exists
|
|
911
|
+
* (mkdtempSync, lchmodSync on macOS), the compiler-rendered SC2020 fence
|
|
912
|
+
* otherwise (scr_throw_lowering_fence). All arguments borrowed. */
|
|
913
|
+
|
|
914
|
+
static bool scr_fs_dyn_absent(const ScrDyn *v) {
|
|
915
|
+
return v->kind == SCR_DYN_UNDEF || v->kind == SCR_DYN_NULL;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
static bool scr_fs_str_is(const ScrStr *s, const char *lit) {
|
|
919
|
+
size_t n = strlen(lit);
|
|
920
|
+
return s->len == n && memcmp(s->data, lit, n) == 0;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/* Node's maybeCallback/validateFunction over a callback slot. */
|
|
924
|
+
static bool scr_fs_cb_chk(const ScrDyn *cb, const char *name) {
|
|
925
|
+
if (cb->kind == SCR_DYN_FUNC) return true;
|
|
926
|
+
scr_dyn_arg_type_fail(name, "of type function", cb);
|
|
927
|
+
return false;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/* getValidatedPath: strings and Buffers pass (URL instances never reach
|
|
931
|
+
* these ladders — the checked-dynamic tree has no URL kind here, and Node would accept
|
|
932
|
+
* only file: URLs anyway). */
|
|
933
|
+
static bool scr_fs_path_chk(const ScrDyn *p, const char *name) {
|
|
934
|
+
if (p->kind == SCR_DYN_STR || scr_dyn_bytes_is(p, SCR_BYTES_U8)) return true;
|
|
935
|
+
scr_dyn_arg_type_fail(name, "of type string or an instance of Buffer or URL", p);
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/* assertEncoding over an options slot (a bare encoding string or an
|
|
940
|
+
* options record's `encoding` member): Node throws ERR_INVALID_ARG_VALUE
|
|
941
|
+
* for any truthy value Buffer.isEncoding rejects. */
|
|
942
|
+
static bool scr_fs_encoding_chk(const ScrDyn *opts) {
|
|
943
|
+
if (opts->kind == SCR_DYN_TYPED_REF) {
|
|
944
|
+
ScrDyn *view = scr_dyn_typed_ref_materialize(opts);
|
|
945
|
+
bool valid = view && !scr_exc_pending() && scr_fs_encoding_chk(view);
|
|
946
|
+
scr_dyn_release(view);
|
|
947
|
+
return valid;
|
|
948
|
+
}
|
|
949
|
+
const ScrDyn *enc = opts;
|
|
950
|
+
if (opts->kind == SCR_DYN_OBJ) {
|
|
951
|
+
enc = scr_dyn_obj_get(opts, "encoding", 8);
|
|
952
|
+
if (enc == NULL) return true;
|
|
953
|
+
}
|
|
954
|
+
if (scr_fs_dyn_absent(enc)) return true;
|
|
955
|
+
if (enc->kind == SCR_DYN_STR) {
|
|
956
|
+
if (enc->v.str->len == 0) return true; /* falsy: assertEncoding's `encoding &&` gate */
|
|
957
|
+
if (scr_bytes_is_encoding(enc->v.str)) return true;
|
|
958
|
+
}
|
|
959
|
+
if (enc->kind == SCR_DYN_BOOL && !enc->v.b) return true;
|
|
960
|
+
if (enc->kind == SCR_DYN_NUM && enc->v.num == 0) return true;
|
|
961
|
+
scr_dyn_arg_value_fail("encoding", "is invalid encoding", enc);
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
/* parseFileMode: integers 0..2^32-1 pass, octal strings parse, and the
|
|
966
|
+
* rest throw Node's exact ladder (validateUint32's wording). */
|
|
967
|
+
static bool scr_fs_mode_chk(const ScrDyn *m, const char *name) {
|
|
968
|
+
if (m->kind == SCR_DYN_STR) {
|
|
969
|
+
const ScrStr *s = m->v.str;
|
|
970
|
+
bool octal = s->len > 0;
|
|
971
|
+
for (size_t i = 0; octal && i < s->len; i++) {
|
|
972
|
+
if (s->data[i] < '0' || s->data[i] > '7') octal = false;
|
|
973
|
+
}
|
|
974
|
+
if (octal) return true;
|
|
975
|
+
scr_dyn_arg_value_fail(name, "must be a 32-bit unsigned integer or an octal string", m);
|
|
976
|
+
return false;
|
|
977
|
+
}
|
|
978
|
+
if (m->kind != SCR_DYN_NUM) {
|
|
979
|
+
scr_dyn_arg_type_fail(name, "of type number", m);
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
double v = m->v.num;
|
|
983
|
+
if (!(isfinite(v) && trunc(v) == v)) {
|
|
984
|
+
char recv[48], msg[160];
|
|
985
|
+
scr_num_received(v, recv);
|
|
986
|
+
int len = snprintf(msg, sizeof msg,
|
|
987
|
+
"The value of \"%s\" is out of range. It must be an integer. Received %s",
|
|
988
|
+
name, recv);
|
|
989
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
if (v < 0 || v > 4294967295.0) {
|
|
993
|
+
char recv[48], msg[160];
|
|
994
|
+
scr_num_received(v, recv);
|
|
995
|
+
int len = snprintf(msg, sizeof msg,
|
|
996
|
+
"The value of \"%s\" is out of range. It must be >= 0 && <= 4294967295. Received %s",
|
|
997
|
+
name, recv);
|
|
998
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
999
|
+
return false;
|
|
1000
|
+
}
|
|
1001
|
+
return true;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/* fs.exists(path, cb) — the REAL deprecated-API shape: the callback
|
|
1005
|
+
* validates synchronously (Node's one throwing arm), and the answer
|
|
1006
|
+
* arrives asynchronously through it — string/Buffer paths run the
|
|
1007
|
+
* existsSync probe at fire time, every other path kind answers `false`
|
|
1008
|
+
* (Node swallows getValidatedPath failures there). The loop-held timer
|
|
1009
|
+
* matches Node's I/O-completion timing closely enough for the
|
|
1010
|
+
* sequential CLI corpus. */
|
|
1011
|
+
#ifndef SCR_LIB
|
|
1012
|
+
static void scr_fs_exists_fire(ScrClosure *self) {
|
|
1013
|
+
ScrDyn *path = scr_box_get_ref(self->caps[0]); /* +1 */
|
|
1014
|
+
ScrDyn *cb = scr_box_get_ref(self->caps[1]); /* +1 */
|
|
1015
|
+
bool ans = false;
|
|
1016
|
+
if (path->kind == SCR_DYN_STR) {
|
|
1017
|
+
ScrStr *p = scr_str_retain(path->v.str);
|
|
1018
|
+
ans = scr_fs_exists(p);
|
|
1019
|
+
scr_str_release(p);
|
|
1020
|
+
} else if (scr_dyn_bytes_is(path, SCR_BYTES_U8)) {
|
|
1021
|
+
ScrStr *p = scr_str_new((const char *)path->v.bytes->data, path->v.bytes->len);
|
|
1022
|
+
ans = scr_fs_exists(p);
|
|
1023
|
+
scr_str_release(p);
|
|
1024
|
+
}
|
|
1025
|
+
ScrDyn *arg = scr_dyn_new_bool(ans);
|
|
1026
|
+
ScrDyn *r = scr_dyn_call(cb, &arg, 1, "the fs.exists callback");
|
|
1027
|
+
scr_dyn_release(arg);
|
|
1028
|
+
scr_dyn_release(r);
|
|
1029
|
+
scr_dyn_release(path);
|
|
1030
|
+
scr_dyn_release(cb);
|
|
1031
|
+
}
|
|
1032
|
+
#endif
|
|
1033
|
+
|
|
1034
|
+
ScrDyn *scr_fs_exists_async(const ScrDyn *path, const ScrDyn *cb) {
|
|
1035
|
+
if (!scr_fs_cb_chk(cb, "cb")) return NULL;
|
|
1036
|
+
if (path->kind != SCR_DYN_STR && !scr_dyn_bytes_is(path, SCR_BYTES_U8)) {
|
|
1037
|
+
/* Node's wart, kept exactly: a path getValidatedPath rejects answers
|
|
1038
|
+
* false through the callback SYNCHRONOUSLY (`return callback(false)`
|
|
1039
|
+
* in lib/fs.js exists). */
|
|
1040
|
+
ScrDyn *arg = scr_dyn_new_bool(false);
|
|
1041
|
+
ScrDyn *r = scr_dyn_call(cb, &arg, 1, "the fs.exists callback");
|
|
1042
|
+
scr_dyn_release(arg);
|
|
1043
|
+
scr_dyn_release(r);
|
|
1044
|
+
if (scr_exc_pending()) return NULL;
|
|
1045
|
+
return scr_dyn_retain(scr_dyn_undefined());
|
|
1046
|
+
}
|
|
1047
|
+
#ifdef SCR_LIB
|
|
1048
|
+
/* Library links exclude the event-loop unit, and the compile-time scan
|
|
1049
|
+
* refuses the fs.exists surface (SC4005's family) — this arm exists
|
|
1050
|
+
* only so the TU links without scr_async. Unreachable by construction. */
|
|
1051
|
+
scr_trap("scriptc: internal error: fs.exists async fire reached in a library build — please report this");
|
|
1052
|
+
return NULL;
|
|
1053
|
+
#else
|
|
1054
|
+
ScrClosure *clo = scr_closure_new((void *)scr_fs_exists_fire, 2);
|
|
1055
|
+
clo->caps[0] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, NULL);
|
|
1056
|
+
scr_box_set_ref(clo->caps[0], scr_dyn_retain((ScrDyn *)path));
|
|
1057
|
+
clo->caps[1] = scr_box_new_obj(scr_dyn_retain_v, scr_dyn_release_v, NULL);
|
|
1058
|
+
scr_box_set_ref(clo->caps[1], scr_dyn_retain((ScrDyn *)cb));
|
|
1059
|
+
scr_set_timeout(clo, 0);
|
|
1060
|
+
return scr_dyn_retain(scr_dyn_undefined());
|
|
1061
|
+
#endif
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/* fs.mkdtemp(prefix, options?, cb): callback first (makeCallback), then
|
|
1065
|
+
* the prefix (getValidatedPath's 'prefix' slot); the async op fences. */
|
|
1066
|
+
void scr_fs_mkdtemp_chk(const ScrDyn *prefix, const ScrDyn *cb, const ScrStr *fence) {
|
|
1067
|
+
if (!scr_fs_cb_chk(cb, "cb")) return;
|
|
1068
|
+
if (!scr_fs_path_chk(prefix, "prefix")) return;
|
|
1069
|
+
scr_throw_lowering_fence(fence);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/* fs.mkdtempSync(prefix, options?): prefix validates (Node's 'prefix'
|
|
1073
|
+
* slot), the options walk accepts only shapes that leave utf8 semantics
|
|
1074
|
+
* (absent/empty records, utf8 spellings — invalid encodings throw the
|
|
1075
|
+
* assertEncoding ladder, other effectful options fence), then the REAL
|
|
1076
|
+
* mkdtemp runs. +1 result or NULL with the exception pending. */
|
|
1077
|
+
ScrStr *scr_fs_mkdtemp_sync_chk(const ScrDyn *prefix, const ScrDyn *opts, const ScrStr *fence) {
|
|
1078
|
+
if (!scr_fs_path_chk(prefix, "prefix")) return NULL;
|
|
1079
|
+
if (!scr_fs_encoding_chk(opts)) return NULL;
|
|
1080
|
+
bool utf8 = true;
|
|
1081
|
+
if (opts->kind == SCR_DYN_OBJ) {
|
|
1082
|
+
for (size_t i = 0; i < opts->v.obj.len; i++) {
|
|
1083
|
+
const ScrDynEntry *e = &opts->v.obj.entries[i];
|
|
1084
|
+
if (scr_fs_dyn_absent(e->value)) continue;
|
|
1085
|
+
if (strcmp(e->key, "encoding") == 0) {
|
|
1086
|
+
const ScrDyn *enc = e->value;
|
|
1087
|
+
if (!(enc->kind == SCR_DYN_STR &&
|
|
1088
|
+
(scr_fs_str_is(enc->v.str, "utf8") || scr_fs_str_is(enc->v.str, "utf-8")))) {
|
|
1089
|
+
utf8 = false;
|
|
1090
|
+
}
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
utf8 = false; /* an unmodeled effectful option */
|
|
1094
|
+
}
|
|
1095
|
+
} else if (opts->kind == SCR_DYN_STR) {
|
|
1096
|
+
utf8 = scr_fs_str_is(opts->v.str, "utf8") || scr_fs_str_is(opts->v.str, "utf-8");
|
|
1097
|
+
} else if (!scr_fs_dyn_absent(opts)) {
|
|
1098
|
+
utf8 = false;
|
|
1099
|
+
}
|
|
1100
|
+
if (!utf8 || prefix->kind != SCR_DYN_STR) {
|
|
1101
|
+
scr_throw_lowering_fence(fence);
|
|
1102
|
+
return NULL;
|
|
1103
|
+
}
|
|
1104
|
+
ScrStr *p = scr_str_retain(prefix->v.str);
|
|
1105
|
+
ScrStr *r = scr_fs_mkdtemp(p);
|
|
1106
|
+
scr_str_release(p);
|
|
1107
|
+
return r;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/* fs.readFile(path, options?, cb): Node's order — the callback
|
|
1111
|
+
* (maybeCallback), the options walk's assertEncoding, then the path;
|
|
1112
|
+
* the async read itself fences. */
|
|
1113
|
+
void scr_fs_read_file_chk(const ScrDyn *path, const ScrDyn *opts, const ScrDyn *cb,
|
|
1114
|
+
const ScrStr *fence) {
|
|
1115
|
+
if (!scr_fs_cb_chk(cb, "cb")) return;
|
|
1116
|
+
if (!scr_fs_encoding_chk(opts)) return;
|
|
1117
|
+
if (!scr_fs_path_chk(path, "path")) return;
|
|
1118
|
+
scr_throw_lowering_fence(fence);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/* fs.opendirSync(path, options?): getValidatedPath, then getOptions'
|
|
1122
|
+
* assertEncoding; the Dir machinery fences. */
|
|
1123
|
+
void scr_fs_opendir_chk(const ScrDyn *path, const ScrDyn *opts, const ScrStr *fence) {
|
|
1124
|
+
if (!scr_fs_path_chk(path, "path")) return;
|
|
1125
|
+
if (!scr_fs_encoding_chk(opts)) return;
|
|
1126
|
+
scr_throw_lowering_fence(fence);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/* fs.watchFile(path, options?, listener): the path first, the listener's
|
|
1130
|
+
* function check second (Node's watchFile order); real watching fences. */
|
|
1131
|
+
void scr_fs_watch_file_chk(const ScrDyn *path, const ScrDyn *listener, const ScrStr *fence) {
|
|
1132
|
+
if (!scr_fs_path_chk(path, "path")) return;
|
|
1133
|
+
if (listener->kind != SCR_DYN_FUNC) {
|
|
1134
|
+
scr_dyn_arg_type_fail("listener", "of type function", listener);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
scr_throw_lowering_fence(fence);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/* fs.lchmod / lchmodSync / fs.promises.lchmod — macOS-only in Node (the
|
|
1141
|
+
* callback/sync pair is not even exported elsewhere, so non-APPLE builds
|
|
1142
|
+
* answer the not-a-function TypeError; the promise form rejects
|
|
1143
|
+
* ERR_METHOD_NOT_IMPLEMENTED, Node's own linux shape). On macOS the
|
|
1144
|
+
* validation ladder runs in Node's order and the real lchmod(2) applies
|
|
1145
|
+
* where an operation survives it. */
|
|
1146
|
+
static bool scr_fs_lchmod_defined(const char *api) {
|
|
1147
|
+
#ifdef __APPLE__
|
|
1148
|
+
(void)api;
|
|
1149
|
+
return true;
|
|
1150
|
+
#else
|
|
1151
|
+
char msg[64];
|
|
1152
|
+
int len = snprintf(msg, sizeof msg, "%s is not a function", api);
|
|
1153
|
+
scr_throw_error_msg(SCR_ERR_TYPE, msg, (size_t)len);
|
|
1154
|
+
return false;
|
|
1155
|
+
#endif
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
void scr_fs_lchmod_chk(const ScrDyn *path, const ScrDyn *mode, const ScrDyn *cb,
|
|
1159
|
+
const ScrStr *fence) {
|
|
1160
|
+
if (!scr_fs_lchmod_defined("fs.lchmod")) return;
|
|
1161
|
+
if (!scr_fs_cb_chk(cb, "cb")) return;
|
|
1162
|
+
if (!scr_fs_path_chk(path, "path")) return;
|
|
1163
|
+
if (!scr_fs_mode_chk(mode, "mode")) return;
|
|
1164
|
+
scr_throw_lowering_fence(fence); /* the async op + callback dispatch */
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
#ifdef __APPLE__
|
|
1168
|
+
static void scr_fs_lchmod_apply(const ScrDyn *path, const ScrDyn *mode) {
|
|
1169
|
+
ScrStr *p = path->kind == SCR_DYN_STR ? scr_str_retain(path->v.str)
|
|
1170
|
+
: scr_str_new((const char *)path->v.bytes->data, path->v.bytes->len);
|
|
1171
|
+
double m = mode->kind == SCR_DYN_NUM ? mode->v.num : (double)strtol(mode->v.str->data, NULL, 8);
|
|
1172
|
+
if (lchmod(p->data, (mode_t)m) != 0) scr_fs_throw(errno, "lchmod", p);
|
|
1173
|
+
scr_str_release(p);
|
|
1174
|
+
}
|
|
1175
|
+
#endif
|
|
1176
|
+
|
|
1177
|
+
/* Answers the dyn undefined (+1) on success — lchmodSync's JS value, so
|
|
1178
|
+
* return-position uses lower; NULL with the exception pending. */
|
|
1179
|
+
ScrDyn *scr_fs_lchmod_sync_chk(const ScrDyn *path, const ScrDyn *mode) {
|
|
1180
|
+
if (!scr_fs_lchmod_defined("fs.lchmodSync")) return NULL;
|
|
1181
|
+
if (!scr_fs_path_chk(path, "path")) return NULL;
|
|
1182
|
+
if (!scr_fs_mode_chk(mode, "mode")) return NULL;
|
|
1183
|
+
#ifdef __APPLE__
|
|
1184
|
+
scr_fs_lchmod_apply(path, mode);
|
|
1185
|
+
if (scr_exc_pending()) return NULL;
|
|
1186
|
+
#endif
|
|
1187
|
+
return scr_dyn_retain(scr_dyn_undefined());
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
ScrPromise *scr_fsp_lchmod_chk(const ScrDyn *path, const ScrDyn *mode) {
|
|
1191
|
+
#ifndef __APPLE__
|
|
1192
|
+
(void)path;
|
|
1193
|
+
(void)mode;
|
|
1194
|
+
static const char ni[] = "The lchmod() method is not implemented";
|
|
1195
|
+
scr_throw_error_msg_code(SCR_ERR_ERROR, ni, sizeof ni - 1, "ERR_METHOD_NOT_IMPLEMENTED");
|
|
1196
|
+
return scr_promise_settled_void();
|
|
1197
|
+
#else
|
|
1198
|
+
if (scr_fs_path_chk(path, "path") && scr_fs_mode_chk(mode, "mode")) {
|
|
1199
|
+
scr_fs_lchmod_apply(path, mode);
|
|
1200
|
+
}
|
|
1201
|
+
return scr_promise_settled_void();
|
|
1202
|
+
#endif
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/* fs.read(fd, buffer, offset, length, position, cb) — the full argument
|
|
1206
|
+
* ladder in Node's order (buffer, fd, offset, length, position); the
|
|
1207
|
+
* async read fences. Bounds follow lib/fs.js read(): offset within the
|
|
1208
|
+
* buffer, length within buffer - offset. */
|
|
1209
|
+
static bool scr_fs_int_range_chk(const ScrDyn *v, const char *name, double min, double max,
|
|
1210
|
+
const char *range) {
|
|
1211
|
+
if (v->kind != SCR_DYN_NUM) {
|
|
1212
|
+
scr_dyn_arg_type_fail(name, "of type number", v);
|
|
1213
|
+
return false;
|
|
1214
|
+
}
|
|
1215
|
+
double n = v->v.num;
|
|
1216
|
+
char recv[48], msg[192];
|
|
1217
|
+
if (!(isfinite(n) && trunc(n) == n)) {
|
|
1218
|
+
scr_num_received(n, recv);
|
|
1219
|
+
int len = snprintf(msg, sizeof msg,
|
|
1220
|
+
"The value of \"%s\" is out of range. It must be an integer. Received %s",
|
|
1221
|
+
name, recv);
|
|
1222
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
1223
|
+
return false;
|
|
1224
|
+
}
|
|
1225
|
+
if (n < min || n > max) {
|
|
1226
|
+
scr_num_received(n, recv);
|
|
1227
|
+
int len = snprintf(msg, sizeof msg,
|
|
1228
|
+
"The value of \"%s\" is out of range. It must be %s. Received %s",
|
|
1229
|
+
name, range, recv);
|
|
1230
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
1231
|
+
return false;
|
|
1232
|
+
}
|
|
1233
|
+
return true;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
static bool scr_fs_read_validate(const ScrDyn *fd, const ScrDyn *buffer, const ScrDyn *offset,
|
|
1237
|
+
const ScrDyn *length, const ScrDyn *position) {
|
|
1238
|
+
if (buffer->kind != SCR_DYN_BYTES) {
|
|
1239
|
+
scr_dyn_arg_type_fail("buffer", "an instance of Buffer, TypedArray, or DataView", buffer);
|
|
1240
|
+
return false;
|
|
1241
|
+
}
|
|
1242
|
+
if (fd->kind != SCR_DYN_NUM) {
|
|
1243
|
+
scr_dyn_arg_type_fail("fd", "of type number", fd);
|
|
1244
|
+
return false;
|
|
1245
|
+
}
|
|
1246
|
+
double buflen = scr_bytes_byte_len(buffer->v.bytes);
|
|
1247
|
+
if (!scr_fs_dyn_absent(offset)) {
|
|
1248
|
+
/* validateInteger's MAX_SAFE range first, the buffer bound second —
|
|
1249
|
+
* Node renders each with its own max. */
|
|
1250
|
+
if (!scr_fs_int_range_chk(offset, "offset", 0, 9007199254740991.0,
|
|
1251
|
+
">= 0 && <= 9007199254740991")) {
|
|
1252
|
+
return false;
|
|
1253
|
+
}
|
|
1254
|
+
if (offset->v.num > buflen) {
|
|
1255
|
+
char range[64];
|
|
1256
|
+
snprintf(range, sizeof range, ">= 0 && <= %.0f", buflen);
|
|
1257
|
+
if (!scr_fs_int_range_chk(offset, "offset", 0, buflen, range)) return false;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
double off = offset->kind == SCR_DYN_NUM ? offset->v.num : 0;
|
|
1261
|
+
if (!scr_fs_dyn_absent(length)) {
|
|
1262
|
+
if (length->kind != SCR_DYN_NUM || !(isfinite(length->v.num) && trunc(length->v.num) == length->v.num) ||
|
|
1263
|
+
length->v.num < 0) {
|
|
1264
|
+
/* Node renders the bare ">= 0" form here (checkPosition's cousin). */
|
|
1265
|
+
if (length->kind == SCR_DYN_NUM) {
|
|
1266
|
+
char recv[48], msg[160];
|
|
1267
|
+
scr_num_received(length->v.num, recv);
|
|
1268
|
+
const char *shape = (isfinite(length->v.num) && trunc(length->v.num) == length->v.num)
|
|
1269
|
+
? "It must be >= 0."
|
|
1270
|
+
: "It must be an integer.";
|
|
1271
|
+
int len = snprintf(msg, sizeof msg,
|
|
1272
|
+
"The value of \"length\" is out of range. %s Received %s", shape, recv);
|
|
1273
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
1274
|
+
return false;
|
|
1275
|
+
}
|
|
1276
|
+
scr_dyn_arg_type_fail("length", "of type number", length);
|
|
1277
|
+
return false;
|
|
1278
|
+
}
|
|
1279
|
+
if (length->v.num > buflen - off) {
|
|
1280
|
+
char recv[48], msg[160];
|
|
1281
|
+
scr_num_received(length->v.num, recv);
|
|
1282
|
+
int len = snprintf(msg, sizeof msg,
|
|
1283
|
+
"The value of \"length\" is out of range. It must be <= %.0f. Received %s",
|
|
1284
|
+
buflen - off, recv);
|
|
1285
|
+
scr_throw_error_msg_code(SCR_ERR_RANGE, msg, (size_t)len, "ERR_OUT_OF_RANGE");
|
|
1286
|
+
return false;
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (!scr_fs_dyn_absent(position)) {
|
|
1290
|
+
if (position->kind != SCR_DYN_NUM) {
|
|
1291
|
+
scr_dyn_arg_type_fail("position", "of type bigint or integer", position);
|
|
1292
|
+
return false;
|
|
1293
|
+
}
|
|
1294
|
+
if (!scr_fs_int_range_chk(position, "position", -1, 9007199254740991.0,
|
|
1295
|
+
">= -1 && <= 9007199254740991")) {
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return true;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
void scr_fs_read_chk(const ScrDyn *fd, const ScrDyn *buffer, const ScrDyn *offset,
|
|
1304
|
+
const ScrDyn *length, const ScrDyn *position, const ScrStr *fence) {
|
|
1305
|
+
if (scr_fs_read_validate(fd, buffer, offset, length, position)) scr_throw_lowering_fence(fence);
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/* createReadStream/createWriteStream(path, options?): getOptions'
|
|
1309
|
+
* assertEncoding, the fd member's FileHandle-or-integer contract when
|
|
1310
|
+
* present, the path contract otherwise; the stream machinery fences. */
|
|
1311
|
+
void scr_fs_stream_opts_chk(const ScrDyn *path, const ScrDyn *opts, const ScrStr *fence) {
|
|
1312
|
+
if (!scr_fs_encoding_chk(opts)) return;
|
|
1313
|
+
const ScrDyn *fd = opts->kind == SCR_DYN_OBJ ? scr_dyn_obj_get(opts, "fd", 2) : NULL;
|
|
1314
|
+
if (fd != NULL && !scr_fs_dyn_absent(fd)) {
|
|
1315
|
+
if (fd->kind != SCR_DYN_NUM) {
|
|
1316
|
+
scr_dyn_prop_type_fail("options.fd", "of type number or an instance of FileHandle", fd);
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
if (!scr_fs_int_range_chk(fd, "fd", 0, 2147483647.0, ">= 0 && <= 2147483647")) return;
|
|
1320
|
+
} else if (!scr_fs_path_chk(path, "path")) {
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1323
|
+
scr_throw_lowering_fence(fence);
|
|
1324
|
+
}
|