@scriptc/cli-darwin-arm64 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES +1 -1
- package/dist/bin/scriptc +0 -0
- package/dist/bin/scriptc.json +1 -1
- package/dist/lib/declarations/scriptc-node-fallback.d.ts +84 -19
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +1 -1
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/library-thread-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/licenses/v8-number-radix.txt +61 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/artifacts/release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-arm64/package.json +1 -1
- package/dist/lib/runtime-darwin-arm64/runtime-pack.json +549 -545
- package/dist/lib/runtime-sources/package.json +1 -1
- package/dist/lib/runtime-sources/src/scr_abort.c +5 -0
- package/dist/lib/runtime-sources/src/scr_array.c +16 -0
- package/dist/lib/runtime-sources/src/scr_assert.c +1 -0
- package/dist/lib/runtime-sources/src/scr_async.c +38 -5
- package/dist/lib/runtime-sources/src/scr_async_dyn.c +208 -40
- package/dist/lib/runtime-sources/src/scr_bigint.c +8 -0
- package/dist/lib/runtime-sources/src/scr_bytes.c +431 -41
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +628 -12
- package/dist/lib/runtime-sources/src/scr_child.c +544 -17
- package/dist/lib/runtime-sources/src/scr_console.c +1 -1
- package/dist/lib/runtime-sources/src/scr_crypto_async.c +22 -2
- package/dist/lib/runtime-sources/src/scr_dyn_invoke.c +344 -73
- package/dist/lib/runtime-sources/src/scr_error.c +52 -5
- package/dist/lib/runtime-sources/src/scr_exception.c +21 -5
- package/dist/lib/runtime-sources/src/scr_fetch.c +311 -3
- package/dist/lib/runtime-sources/src/scr_file_handle.c +31 -0
- package/dist/lib/runtime-sources/src/scr_http.c +3 -0
- package/dist/lib/runtime-sources/src/scr_island.c +1226 -405
- package/dist/lib/runtime-sources/src/scr_island_manifest.h +11 -9
- package/dist/lib/runtime-sources/src/scr_json.c +1594 -139
- package/dist/lib/runtime-sources/src/scr_json.test.ts +1 -0
- package/dist/lib/runtime-sources/src/scr_lib.c +816 -34
- package/dist/lib/runtime-sources/src/scr_map.c +47 -0
- package/dist/lib/runtime-sources/src/scr_node_builtin.c +10 -0
- package/dist/lib/runtime-sources/src/scr_object.c +11 -0
- package/dist/lib/runtime-sources/src/scr_qs.c +10 -0
- package/dist/lib/runtime-sources/src/scr_regex.c +148 -72
- package/dist/lib/runtime-sources/src/scr_runtime.h +257 -41
- package/dist/lib/runtime-sources/src/scr_stream.c +197 -0
- package/dist/lib/runtime-sources/src/scr_string.c +16 -1
- package/dist/lib/runtime-sources/src/scr_symbol.c +5 -0
- package/dist/lib/runtime-sources/src/scr_text_decoder_labels.h +225 -0
- package/dist/lib/runtime-sources/src/scr_url.c +206 -10
- package/dist/lib/runtime-sources/src/scr_web.c +129 -26
- package/dist/lib/runtime-sources/vendor/v8-number-radix/LICENSE +61 -0
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ void scr_init(void);
|
|
|
62
62
|
/* Program objects emitted by the bundled LLVM helper reference this symbol.
|
|
63
63
|
* Its versioned spelling makes a mismatched manual runtime link fail before
|
|
64
64
|
* the program can start. */
|
|
65
|
-
void
|
|
65
|
+
void scr_runtime_abi_v6(void);
|
|
66
66
|
|
|
67
67
|
/* ── the trap funnel (scr_console.c; scr_library.c under -DSCR_LIB) ──────
|
|
68
68
|
* Every unrecoverable runtime trap — OOM, semantic range traps, internal-
|
|
@@ -78,6 +78,31 @@ void scr_runtime_abi_v5(void);
|
|
|
78
78
|
* structured trap-teaching form before delivery (a message that already
|
|
79
79
|
* begins with the 0x01 marker passes verbatim) — see ScrLibSinkFn below. */
|
|
80
80
|
_Noreturn void scr_trap(const char *msg);
|
|
81
|
+
|
|
82
|
+
/* glibc added arc4random_buf in 2.36. Older GNU targets use the same kernel
|
|
83
|
+
* CSPRNG as the musl shim, with no global state or persistent descriptor. */
|
|
84
|
+
#ifdef __GLIBC__
|
|
85
|
+
#if !__GLIBC_PREREQ(2, 36)
|
|
86
|
+
#include <errno.h>
|
|
87
|
+
#include <stdlib.h>
|
|
88
|
+
#include <sys/random.h>
|
|
89
|
+
static inline void scr_glibc_random_buf(void *buf, size_t n) {
|
|
90
|
+
unsigned char *p = buf;
|
|
91
|
+
while (n > 0) {
|
|
92
|
+
ssize_t got = getrandom(p, n, 0);
|
|
93
|
+
if (got > 0) {
|
|
94
|
+
p += (size_t)got;
|
|
95
|
+
n -= (size_t)got;
|
|
96
|
+
} else if (got < 0 && errno == EINTR) {
|
|
97
|
+
continue;
|
|
98
|
+
} else {
|
|
99
|
+
scr_trap("scriptc: getrandom failed\n");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
#define arc4random_buf scr_glibc_random_buf
|
|
104
|
+
#endif
|
|
105
|
+
#endif
|
|
81
106
|
_Noreturn void scr_trap_fmt(const char *fmt, ...);
|
|
82
107
|
|
|
83
108
|
/* ── library mode (scr_library.c, linked only into library artifacts) ─────
|
|
@@ -472,6 +497,7 @@ typedef struct ScrClassObj {
|
|
|
472
497
|
size_t ncaps;
|
|
473
498
|
size_t length;
|
|
474
499
|
struct ScrBox *prototype_data;
|
|
500
|
+
struct ScrBox *static_data;
|
|
475
501
|
struct ScrBox *caps[];
|
|
476
502
|
} ScrClassObj;
|
|
477
503
|
|
|
@@ -483,6 +509,7 @@ static inline ScrClassObj *scr_classobj_retain(ScrClassObj *c) {
|
|
|
483
509
|
return c;
|
|
484
510
|
}
|
|
485
511
|
void scr_classobj_release(ScrClassObj *c);
|
|
512
|
+
void scr_classobj_clear_properties(ScrClassObj *c);
|
|
486
513
|
ScrClassObj *scr_classobj_new(const ScrClassObj *template, size_t ncaps);
|
|
487
514
|
void scr_classobj_trace_v(void *c, ScrTraceVisit visit, void *ctx);
|
|
488
515
|
/* void*-signature RC adapters (container slots) — scr_object.c. */
|
|
@@ -492,8 +519,16 @@ void scr_classobj_release_v(void *c);
|
|
|
492
519
|
ScrStr *scr_classobj_name(ScrClassObj *c);
|
|
493
520
|
struct ScrDyn *scr_dyn_class_prototype(struct ScrDyn *value, struct ScrDyn *base);
|
|
494
521
|
struct ScrDyn *scr_dyn_class_base_prototype(struct ScrDyn *constructor);
|
|
522
|
+
struct ScrDyn *scr_dyn_class_inherit(struct ScrDyn *constructor, struct ScrDyn *base);
|
|
495
523
|
void scr_dyn_class_super(struct ScrDyn *constructor, struct ScrDyn *receiver, struct ScrDyn *arguments);
|
|
496
524
|
struct ScrDyn *scr_dyn_assign_prototype(struct ScrDyn *target, struct ScrDyn *sources, struct ScrDyn *protected_keys);
|
|
525
|
+
struct ScrDyn *scr_dyn_bag_get(struct ScrDyn *bag, ScrStr *key, struct ScrDyn *receiver);
|
|
526
|
+
struct ScrDyn *scr_dyn_reflect_get(struct ScrDyn *target, struct ScrDyn *key, struct ScrDyn *receiver);
|
|
527
|
+
bool scr_dyn_reflect_set(struct ScrDyn *target, struct ScrDyn *key, struct ScrDyn *value, struct ScrDyn *receiver);
|
|
528
|
+
bool scr_dyn_reflect_define(struct ScrDyn *receiver, struct ScrDyn *key, struct ScrDyn *value);
|
|
529
|
+
bool scr_dyn_abstract_eq(const struct ScrDyn *left, const struct ScrDyn *right);
|
|
530
|
+
int scr_dyn_function_kind(const struct ScrDyn *value);
|
|
531
|
+
void scr_dyn_bag_set(struct ScrDyn *bag, ScrStr *key, struct ScrDyn *value, struct ScrDyn *receiver);
|
|
497
532
|
/* The keyed-write miss on a fixed-shape record: throws the catchable
|
|
498
533
|
* TypeError naming the key (JS would add the property — the documented
|
|
499
534
|
* monomorphic-struct divergence). scr_object.c. */
|
|
@@ -531,6 +566,10 @@ typedef struct ScrError {
|
|
|
531
566
|
* embed the slot and release it NULL-guarded. */
|
|
532
567
|
struct ScrDyn *error_cause; /* NULL = absent; dyn undefined = present */
|
|
533
568
|
bool cause_enumerable; /* assignment creates an enumerable own property */
|
|
569
|
+
bool message_present; /* super() leaves the inherited message property visible */
|
|
570
|
+
bool message_enumerable; /* assignment creates an enumerable own property */
|
|
571
|
+
bool name_present;
|
|
572
|
+
bool name_enumerable;
|
|
534
573
|
ScrStr *stack_frames; /* captured native source frames */
|
|
535
574
|
ScrStr *stack; /* lazily formatted, cached stack */
|
|
536
575
|
} ScrError;
|
|
@@ -564,6 +603,10 @@ typedef struct ScrDomException {
|
|
|
564
603
|
ScrStr *code; /* the Node string-code slot (stays NULL here) */
|
|
565
604
|
struct ScrDyn *error_cause; /* shared ScrError prefix; unused by DOMException */
|
|
566
605
|
bool cause_enumerable;
|
|
606
|
+
bool message_present;
|
|
607
|
+
bool message_enumerable;
|
|
608
|
+
bool name_present;
|
|
609
|
+
bool name_enumerable;
|
|
567
610
|
ScrStr *stack_frames;
|
|
568
611
|
ScrStr *stack;
|
|
569
612
|
double dom_code; /* the WebIDL legacy code (0 when the name is off-table) */
|
|
@@ -617,11 +660,15 @@ void scr_error_init_options(void *obj, int kind, const struct ScrDyn *message, c
|
|
|
617
660
|
void scr_error_install_cause_drop(void (*fn)(void *obj));
|
|
618
661
|
bool scr_error_has_cause(ScrError *e);
|
|
619
662
|
struct ScrDyn *scr_error_cause(ScrError *e); /* +1, undefined when absent */
|
|
663
|
+
void scr_error_define_cause(ScrError *e, struct ScrDyn *value);
|
|
620
664
|
void scr_error_set_cause(ScrError *e, struct ScrDyn *value); /* borrowed operands */
|
|
621
665
|
void scr_error_delete_cause(ScrError *e);
|
|
622
666
|
/* ECMA Error.prototype.toString: "", name, message, or "name: message".
|
|
623
667
|
* Borrows e, returns +1. */
|
|
624
668
|
ScrStr *scr_error_to_string(ScrError *e);
|
|
669
|
+
void scr_error_install_message_reader(ScrStr *(*reader)(ScrError *));
|
|
670
|
+
void scr_error_install_name_reader(ScrStr *(*reader)(ScrError *));
|
|
671
|
+
ScrStr *scr_error_default_name(const ScrError *e);
|
|
625
672
|
ScrStr *scr_error_stack(ScrError *e);
|
|
626
673
|
|
|
627
674
|
ScrError *scr_error_retain(ScrError *e);
|
|
@@ -732,6 +779,7 @@ ScrStr *scr_str_trim(ScrStr *s);
|
|
|
732
779
|
* sets the regex link flag for case-conversion sites). Borrow s; +1. */
|
|
733
780
|
ScrStr *scr_str_to_lower(const ScrStr *s);
|
|
734
781
|
ScrStr *scr_str_to_upper(const ScrStr *s);
|
|
782
|
+
ScrStr *scr_str_normalize(const ScrStr *s, const ScrStr *form);
|
|
735
783
|
|
|
736
784
|
/* charAt(i): 1-code-unit string; out of range → empty string. Half of an
|
|
737
785
|
* astral pair → U+FFFD (divergence, see above). Returns +1. */
|
|
@@ -813,6 +861,7 @@ ScrStr *scr_str_encode_uri_component(ScrStr *s);
|
|
|
813
861
|
* hex or an invalid sequence THROWS the spec's catchable URIError ("URI
|
|
814
862
|
* malformed") and returns NULL. Borrows s; result +1. */
|
|
815
863
|
ScrStr *scr_str_decode_uri_component(ScrStr *s);
|
|
864
|
+
ScrStr *scr_str_decode_uri(ScrStr *s);
|
|
816
865
|
|
|
817
866
|
/* The non-throwing core of decodeURIComponent: NULL on malformed input
|
|
818
867
|
* instead of the URIError — the try/catch shape node:querystring's
|
|
@@ -863,6 +912,12 @@ void scr_qs_parse_into(ScrMap *out, const ScrStr *qs, const ScrStr *sep,
|
|
|
863
912
|
* Borrows config; returns +1, or NULL with a Node-coded TypeError pending. */
|
|
864
913
|
struct ScrDyn *scr_util_parse_args(const struct ScrDyn *config);
|
|
865
914
|
|
|
915
|
+
/* Node 24's dotenv grammar, shared by util.parseEnv and process.loadEnvFile.
|
|
916
|
+
* Arguments are borrowed; parseEnv returns a fresh ordinary object (+1).
|
|
917
|
+
* Validation and file failures leave a coded exception pending. */
|
|
918
|
+
struct ScrDyn *scr_util_parse_env(const struct ScrDyn *content);
|
|
919
|
+
void scr_process_load_env_file(const struct ScrDyn *path);
|
|
920
|
+
|
|
866
921
|
/* querystring.stringify — Node's stringify over a borrowed dyn value (the
|
|
867
922
|
* frontend dynFroms the typed record; JS-world dyn values pass straight
|
|
868
923
|
* through). Non-object dyn values answer "" like Node; object keys iterate in
|
|
@@ -966,6 +1021,7 @@ typedef struct ScrArr {
|
|
|
966
1021
|
struct ScrArrProp *props; /* noncanonical numeric properties */
|
|
967
1022
|
size_t prop_len;
|
|
968
1023
|
size_t prop_cap;
|
|
1024
|
+
struct ScrDyn *metadata; /* heterogeneous named properties of match results */
|
|
969
1025
|
} ScrArr;
|
|
970
1026
|
|
|
971
1027
|
typedef struct ScrArrSparseSlot {
|
|
@@ -1003,6 +1059,7 @@ static inline ScrArr *scr_arr_retain(ScrArr *a) {
|
|
|
1003
1059
|
* NULL-tolerant (uninitialized locals). Cycle-capable arrays (elem_trace
|
|
1004
1060
|
* non-NULL) feed the candidate-root buffer like every headered type. */
|
|
1005
1061
|
void scr_arr_release(ScrArr *a);
|
|
1062
|
+
void scr_arr_copy_metadata(ScrArr *a, struct ScrDyn *target);
|
|
1006
1063
|
|
|
1007
1064
|
/* Trace entry point for cycle-capable arrays — stored in their collector
|
|
1008
1065
|
* header and passed wherever a container stores an ARRAY payload's RC entry
|
|
@@ -1161,16 +1218,15 @@ ScrStr *scr_str_raw(ScrArr *raw, ScrArr *subs);
|
|
|
1161
1218
|
/* ── regular expressions (scr_regex.c — linked ONLY when the program
|
|
1162
1219
|
* contains a regex literal; see native-toolchain.ts) ────────────────────────────────
|
|
1163
1220
|
* The engine is quickjs-ng's libregexp (the same bytecode interpreter the
|
|
1164
|
-
* dynamic island uses), compiled standalone.
|
|
1165
|
-
*
|
|
1166
|
-
* (pattern, flags) pair
|
|
1167
|
-
*
|
|
1221
|
+
* dynamic island uses), compiled standalone. Each regex literal evaluation
|
|
1222
|
+
* creates a fresh refcounted instance sharing an immortal template per
|
|
1223
|
+
* (pattern, flags) pair. Template bytecode compiles lazily on first use
|
|
1224
|
+
* and is freed at exit; constructed regexes own their bytecode.
|
|
1168
1225
|
* Subjects are matched as UTF-16 (converted per call from the UTF-8
|
|
1169
1226
|
* storage), so all observable index behavior is UTF-16-exact like Node.
|
|
1170
1227
|
*
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
1173
|
-
* test() on a g/y-flagged regex aborts with a clear message.
|
|
1228
|
+
* Global and sticky regexes carry numeric lastIndex. Exec/test update it
|
|
1229
|
+
* after matching; String methods apply their specified state rules.
|
|
1174
1230
|
*
|
|
1175
1231
|
* Ownership: subjects/replacements are BORROWED; string/array results
|
|
1176
1232
|
* return +1. replace_all without /g THROWS a catchable TypeError
|
|
@@ -1178,10 +1234,12 @@ ScrStr *scr_str_raw(ScrArr *raw, ScrArr *subs);
|
|
|
1178
1234
|
* checks); every other failure mode aborts.
|
|
1179
1235
|
*/
|
|
1180
1236
|
typedef struct ScrRegex {
|
|
1181
|
-
size_t rc; /* SIZE_MAX = immortal
|
|
1237
|
+
size_t rc; /* SIZE_MAX = immortal literal template */
|
|
1182
1238
|
ScrStr *source; /* pattern text between the slashes */
|
|
1183
1239
|
ScrStr *flags; /* flags text, source order (alphabet fenced to gimsuy) */
|
|
1184
1240
|
uint8_t *bc; /* lazily compiled libregexp bytecode; NULL until first use */
|
|
1241
|
+
double last_index;
|
|
1242
|
+
struct ScrRegex *literal; /* immutable bytecode owner for literal instances */
|
|
1185
1243
|
} ScrRegex;
|
|
1186
1244
|
|
|
1187
1245
|
static inline ScrRegex *scr_regex_retain(ScrRegex *re) {
|
|
@@ -1192,6 +1250,8 @@ static inline ScrRegex *scr_regex_retain(ScrRegex *re) {
|
|
|
1192
1250
|
void scr_regex_release(ScrRegex *re); /* NULL-tolerant */
|
|
1193
1251
|
void *scr_regex_retain_v(void *re);
|
|
1194
1252
|
void scr_regex_release_v(void *re);
|
|
1253
|
+
ScrRegex *scr_regex_literal(ScrRegex *literal); /* fresh state, shared cached bytecode */
|
|
1254
|
+
double scr_regex_last_index(ScrRegex *re);
|
|
1195
1255
|
|
|
1196
1256
|
/* new RegExp(pattern, flags): a heap ScrRegex over the same engine. The
|
|
1197
1257
|
* pattern compiles EAGERLY — an invalid pattern or flag throws Node's
|
|
@@ -1200,11 +1260,14 @@ void scr_regex_release_v(void *re);
|
|
|
1200
1260
|
* spec's "(?:)" source. Borrows both; +1, NULL after a throw. */
|
|
1201
1261
|
ScrRegex *scr_regex_new(ScrStr *pattern, ScrStr *flags);
|
|
1202
1262
|
|
|
1203
|
-
bool scr_regex_test(ScrRegex *re, ScrStr *s); /*
|
|
1204
|
-
/* s.match(re): +1 string[] of
|
|
1205
|
-
* captures hold ""
|
|
1206
|
-
*
|
|
1263
|
+
bool scr_regex_test(ScrRegex *re, ScrStr *s); /* exec state transitions */
|
|
1264
|
+
/* s.match(re): +1 string[] of whole matches under /g, otherwise
|
|
1265
|
+
* [whole, ...captures] (nonparticipating captures hold ""), or NULL for
|
|
1266
|
+
* no match. Non-global /y uses exec state transitions. Borrows both. */
|
|
1207
1267
|
ScrArr *scr_regex_match(ScrStr *s, ScrRegex *re);
|
|
1268
|
+
/* re.exec(s), string-first ABI: match slice with global/sticky lastIndex
|
|
1269
|
+
* transitions. Borrows both; +1 or NULL. */
|
|
1270
|
+
ScrArr *scr_regex_exec(ScrStr *s, ScrRegex *re);
|
|
1208
1271
|
/* s.search(re): the first match's UTF-16 index, or -1 — a fresh exec from
|
|
1209
1272
|
* position 0 (Symbol.search never touches lastIndex, so no flag fence:
|
|
1210
1273
|
* /g is irrelevant, /y anchors at 0). Borrows both; never throws. */
|
|
@@ -1277,6 +1340,17 @@ typedef struct {
|
|
|
1277
1340
|
bool live; /* false = tombstone (key/val already released) */
|
|
1278
1341
|
} ScrMapEntry;
|
|
1279
1342
|
|
|
1343
|
+
/* Checked views use the original storage. Slot converters borrow on reads
|
|
1344
|
+
* and return owned references on writes, just like typed Map operations. */
|
|
1345
|
+
typedef struct {
|
|
1346
|
+
const char *type;
|
|
1347
|
+
struct ScrDyn *(*key_box)(uint64_t);
|
|
1348
|
+
uint64_t (*key_unbox)(const struct ScrDyn *);
|
|
1349
|
+
bool (*key_matches)(const struct ScrDyn *);
|
|
1350
|
+
struct ScrDyn *(*val_box)(uint64_t);
|
|
1351
|
+
uint64_t (*val_unbox)(const struct ScrDyn *);
|
|
1352
|
+
} ScrMapDynOps;
|
|
1353
|
+
|
|
1280
1354
|
typedef struct ScrMap {
|
|
1281
1355
|
size_t rc; /* SIZE_MAX = immortal (unused for maps; kept per convention) */
|
|
1282
1356
|
ScrMapKeyKind key_kind;
|
|
@@ -1297,8 +1371,16 @@ typedef struct ScrMap {
|
|
|
1297
1371
|
size_t nbuckets; /* power of two; >= 2 * ecap so probes terminate */
|
|
1298
1372
|
size_t *buckets; /* entry indices; SIZE_MAX = empty */
|
|
1299
1373
|
size_t iter_depth; /* > 0: an iteration is active — no compaction */
|
|
1374
|
+
const ScrMapDynOps *dyn_ops;
|
|
1300
1375
|
} ScrMap;
|
|
1301
1376
|
|
|
1377
|
+
void scr_map_dyn_attach(ScrMap *map, const ScrMapDynOps *ops);
|
|
1378
|
+
struct ScrDyn *scr_map_dyn_key(const ScrMap *map, double index);
|
|
1379
|
+
struct ScrDyn *scr_map_dyn_value(const ScrMap *map, double index);
|
|
1380
|
+
struct ScrDyn *scr_map_dyn_get(ScrMap *map, const struct ScrDyn *key);
|
|
1381
|
+
bool scr_map_dyn_has(ScrMap *map, const struct ScrDyn *key, bool remove);
|
|
1382
|
+
void scr_map_dyn_set(ScrMap *map, const struct ScrDyn *key, const struct ScrDyn *value, bool set);
|
|
1383
|
+
|
|
1302
1384
|
/* retain/release/trace are NULL for scalar value kinds; retain/release are
|
|
1303
1385
|
* required for SCR_MAP_VAL_REF; trace is non-NULL iff the value type is
|
|
1304
1386
|
* cycle-capable (the map then allocates with the collector header). */
|
|
@@ -1477,7 +1559,7 @@ typedef struct ScrClosure {
|
|
|
1477
1559
|
* (like the dyn→closure edge): a cycle through it is merely never
|
|
1478
1560
|
* collected. */
|
|
1479
1561
|
ScrBox *props;
|
|
1480
|
-
uint32_t function_kind; /* low bits: 0 ordinary, 1 generator, 2 async, 3 async generator; bit 2: ordinary own prototype */
|
|
1562
|
+
uint32_t function_kind; /* low bits: 0 ordinary, 1 generator, 2 async, 3 async generator; bit 2: ordinary own prototype; bit 3: checked callable adapter in caps[0] */
|
|
1481
1563
|
ScrBox *caps[];
|
|
1482
1564
|
} ScrClosure;
|
|
1483
1565
|
|
|
@@ -1997,7 +2079,9 @@ ScrStream *scr_stream_set_push_encoding(ScrStream *s, ScrStr *enc);
|
|
|
1997
2079
|
bool scr_stream_push_null(ScrStream *s);
|
|
1998
2080
|
void scr_stream_unshift(ScrStream *s, ScrBytes *chunk);
|
|
1999
2081
|
void scr_stream_unshift_str(ScrStream *s, ScrStr *str);
|
|
2000
|
-
ScrBytes *scr_stream_read(ScrStream *s, double size);
|
|
2082
|
+
ScrBytes *scr_stream_read(ScrStream *s, double size);
|
|
2083
|
+
ScrStream *scr_stream_on_dyn(ScrStream *s, ScrStr *name, ScrDyn *cb, bool once, bool prepend);
|
|
2084
|
+
ScrDyn *scr_stream_read_dyn(ScrStream *s, ScrDyn *size); /* +1 or NULL; size < 0 = all/first; throws once encoded (the static type is Buffer|null) */
|
|
2001
2085
|
/* setEncoding(enc): string-chunk mode — pushes decode through the
|
|
2002
2086
|
* StringDecoder, 'data' delivers strings (the emit ABI carries both
|
|
2003
2087
|
* payload slots; see scr_stream_emit_data), lengths count JS string
|
|
@@ -2212,10 +2296,8 @@ void scr_exc_clear(void);
|
|
|
2212
2296
|
* refcounted local, and every runtime question a catch body may ask —
|
|
2213
2297
|
* typeof-style kind tests (emitted as direct kind reads), instanceof over
|
|
2214
2298
|
* hierarchy payloads, payload extraction, rethrow — reads the box. The box
|
|
2215
|
-
*
|
|
2216
|
-
*
|
|
2217
|
-
* payload reference simply counts as an external edge — trial deletion
|
|
2218
|
-
* restores it on scan. */
|
|
2299
|
+
* participates in cycle collection because a closure may capture the
|
|
2300
|
+
* binding and its payload may retain that closure. */
|
|
2219
2301
|
typedef struct ScrCaught {
|
|
2220
2302
|
size_t rc;
|
|
2221
2303
|
ScrExcKind kind; /* never SCR_EXC_NONE */
|
|
@@ -2230,6 +2312,7 @@ typedef struct ScrCaught {
|
|
|
2230
2312
|
ScrCaught *scr_exc_take(void); /* moves the pending cell into a fresh box (+1) */
|
|
2231
2313
|
ScrCaught *scr_caught_retain(ScrCaught *c);
|
|
2232
2314
|
void scr_caught_release(ScrCaught *c); /* NULL-tolerant */
|
|
2315
|
+
void scr_caught_trace_v(void *c, ScrTraceVisit visit, void *ctx);
|
|
2233
2316
|
/* Replace the pending disposal error with a SuppressedError and consume the
|
|
2234
2317
|
* original body-error snapshot. The current exception cell must be pending. */
|
|
2235
2318
|
void scr_exc_suppress(ScrCaught *suppressed);
|
|
@@ -2530,6 +2613,8 @@ ScrStats *scr_fs_lstat(ScrStr *path); /* +1, or throws; NO follow (lstat) */
|
|
|
2530
2613
|
ScrStats *scr_fs_fstat(double fd); /* +1, or throws */
|
|
2531
2614
|
void scr_fs_fchmod(double fd, double mode);
|
|
2532
2615
|
void scr_fs_fsync(double fd);
|
|
2616
|
+
void scr_fs_fdatasync(double fd);
|
|
2617
|
+
void scr_fs_ftruncate(double fd, double length);
|
|
2533
2618
|
void scr_fs_link(ScrStr *source, ScrStr *dest);
|
|
2534
2619
|
ScrStats *scr_stats_retain(ScrStats *s);
|
|
2535
2620
|
void scr_stats_release(ScrStats *s);
|
|
@@ -2814,7 +2899,11 @@ ScrChild *scr_fork(double target, ScrArr *args, double in_mode,
|
|
|
2814
2899
|
ScrChild *scr_spawn_opts(ScrStr *cmd, ScrArr *args, double in_mode,
|
|
2815
2900
|
double out_mode, double err_mode, double out_fd,
|
|
2816
2901
|
double err_fd, bool detached, bool shell, bool has_env,
|
|
2817
|
-
|
|
2902
|
+
ScrArr *env_pairs, ScrStr *cwd);
|
|
2903
|
+
/* Runtime options use the same spawn core; validation and explicit
|
|
2904
|
+
* unsupported-option refusals throw before starting a child. Borrows. */
|
|
2905
|
+
ScrChild *scr_spawn_dynamic(ScrStr *cmd, ScrArr *args, const ScrDyn *options);
|
|
2906
|
+
void scr_child_on_spawn(ScrChild *child, ScrClosure *cb); /* moves zero-argument callback */
|
|
2818
2907
|
/* The callback slice: file + args, default options. The returned child has
|
|
2819
2908
|
* all three stdio slots piped; stdout/stderr are captured internally and
|
|
2820
2909
|
* the callback moves into the child registry until settlement. */
|
|
@@ -2902,9 +2991,28 @@ bool scr_child_killed(ScrChild *c);
|
|
|
2902
2991
|
bool scr_child_kill(ScrChild *c, const ScrStr *signal);
|
|
2903
2992
|
bool scr_child_kill_num(ScrChild *c, double signum);
|
|
2904
2993
|
void scr_child_unref(ScrChild *c);
|
|
2994
|
+
void scr_child_ref(ScrChild *c);
|
|
2905
2995
|
/* Installs ChildProcess's checked-dynamic handle identity bridge. Emitted
|
|
2906
2996
|
* programs call this only when the child_process surface is present. */
|
|
2907
2997
|
void scr_child_dyn_install(void);
|
|
2998
|
+
void scr_child_on_dyn(ScrChild *child, ScrStr *event, ScrDyn *listener); /* borrowed */
|
|
2999
|
+
/* Optional native-stream bridge. The table avoids a stream dependency
|
|
3000
|
+
* in programs that only use the child-process surface. */
|
|
3001
|
+
typedef struct ScrChildStreamOps {
|
|
3002
|
+
ScrStream *(*readable)(void);
|
|
3003
|
+
ScrStream *(*writable)(ScrClosure *, ScrStreamChunkInv, ScrClosure *, ScrStreamPlainInv);
|
|
3004
|
+
void *(*retain)(void *);
|
|
3005
|
+
void (*release)(void *);
|
|
3006
|
+
ScrTraceFn trace;
|
|
3007
|
+
bool (*push)(ScrStream *, ScrBytes *);
|
|
3008
|
+
bool (*end)(ScrStream *);
|
|
3009
|
+
void (*write_done)(ScrStream *, ScrError *);
|
|
3010
|
+
void (*final_done)(ScrStream *, ScrError *);
|
|
3011
|
+
} ScrChildStreamOps;
|
|
3012
|
+
extern const ScrChildStreamOps scr_stream_child_ops;
|
|
3013
|
+
ScrDyn *scr_stream_dyn_view(ScrStream *stream); /* borrowed; +1 live method/property view */
|
|
3014
|
+
void scr_child_dyn_streams_install(const ScrChildStreamOps *ops,
|
|
3015
|
+
ScrDyn *(*readable_box)(void *), ScrDyn *(*writable_box)(void *));
|
|
2908
3016
|
bool scr_children_reffed_pending(void);
|
|
2909
3017
|
void scr_children_teardown(void);
|
|
2910
3018
|
/* Node's signal-name table (scr_lib.c), shared with child.kill: the
|
|
@@ -2943,6 +3051,7 @@ ScrStr *scr_crypto_hash_digest_str(ScrStr *alg, ScrStr *data, ScrStr *enc);
|
|
|
2943
3051
|
ScrStr *scr_crypto_hash_digest_bytes(ScrStr *alg, ScrBytes *data, ScrStr *enc);
|
|
2944
3052
|
typedef struct ScrCryptoHash ScrCryptoHash;
|
|
2945
3053
|
ScrCryptoHash *scr_crypto_hash_new(ScrStr *alg);
|
|
3054
|
+
ScrDyn *scr_crypto_native(void);
|
|
2946
3055
|
ScrCryptoHash *scr_crypto_hmac_new_str(ScrStr *alg, ScrStr *key);
|
|
2947
3056
|
ScrCryptoHash *scr_crypto_hmac_new_bytes(ScrStr *alg, ScrBytes *key);
|
|
2948
3057
|
ScrCryptoHash *scr_crypto_hash_retain(ScrCryptoHash *h);
|
|
@@ -2960,22 +3069,33 @@ ScrBytes *scr_crypto_random_fill_rest(ScrBytes *bytes, double offset);
|
|
|
2960
3069
|
double scr_crypto_random_int(double min, double max);
|
|
2961
3070
|
ScrBytes *scr_crypto_pbkdf2(ScrBytes *password, ScrBytes *salt,
|
|
2962
3071
|
double iterations, double keylen, ScrStr *digest);
|
|
2963
|
-
|
|
2964
|
-
|
|
3072
|
+
ScrBytes *scr_crypto_hkdf_bytes(ScrStr *digest, ScrBytes *ikm, ScrBytes *salt,
|
|
3073
|
+
ScrBytes *info, double keylen);
|
|
3074
|
+
ScrDyn *scr_crypto_hkdf(ScrStr *digest, ScrBytes *ikm, ScrBytes *salt,
|
|
3075
|
+
ScrBytes *info, double keylen);
|
|
3076
|
+
ScrBytes *scr_crypto_scrypt(ScrBytes *password, ScrBytes *salt, double keylen, ScrDyn *options);
|
|
3077
|
+
ScrBytes *scr_crypto_scrypt_derive(ScrBytes *password, ScrBytes *salt, double keylen,
|
|
3078
|
+
double n, double r, double p, double maxmem);
|
|
3079
|
+
typedef void (*ScrCryptoBytesFn)(ScrClosure *cb, ScrError *error /* borrowed */, ScrBytes *value /* moves */);
|
|
3080
|
+
void scr_crypto_defer_bytes(ScrBytes *value /* moves */, ScrError *error /* moves */, ScrClosure *cb /* moves */,
|
|
2965
3081
|
ScrCryptoBytesFn fn);
|
|
2966
3082
|
void scr_crypto_random_bytes_async(double size, ScrClosure *cb /* moves */,
|
|
2967
3083
|
ScrCryptoBytesFn fn);
|
|
2968
3084
|
void scr_crypto_pbkdf2_async(ScrBytes *password, ScrBytes *salt,
|
|
2969
3085
|
double iterations, double keylen, ScrStr *digest,
|
|
2970
3086
|
ScrClosure *cb /* moves */, ScrCryptoBytesFn fn);
|
|
2971
|
-
|
|
3087
|
+
void scr_crypto_hkdf_async(ScrStr *digest, ScrBytes *ikm, ScrBytes *salt,
|
|
3088
|
+
ScrBytes *info, double keylen, ScrClosure *cb, ScrCryptoBytesFn fn);
|
|
3089
|
+
void scr_crypto_scrypt_async(ScrBytes *password, ScrBytes *salt, double keylen,
|
|
3090
|
+
ScrDyn *options, ScrClosure *cb, ScrCryptoBytesFn fn);
|
|
3091
|
+
/* One-shot raw digest/HMAC by algorithm name ("md5", "sha1", and SHA-2)
|
|
2972
3092
|
* — the island crypto shim's bridge (scr_island.c host hooks). Digest
|
|
2973
|
-
* bytes into out (≥
|
|
3093
|
+
* bytes into out (≥64); returns the digest length, 0 for an unknown
|
|
2974
3094
|
* algorithm. */
|
|
2975
3095
|
size_t scr_crypto_digest_raw(const char *alg, const unsigned char *data, size_t len,
|
|
2976
|
-
unsigned char out[
|
|
3096
|
+
unsigned char out[64]);
|
|
2977
3097
|
size_t scr_crypto_hmac_raw(const char *alg, const unsigned char *key, size_t keylen,
|
|
2978
|
-
const unsigned char *data, size_t len, unsigned char out[
|
|
3098
|
+
const unsigned char *data, size_t len, unsigned char out[64]);
|
|
2979
3099
|
/* The composed `new crypto.X509Certificate(data).fingerprint` read (the
|
|
2980
3100
|
* handle never materializes): the SHA-1 of the DER, uppercase
|
|
2981
3101
|
* colon-separated — PEM or raw-DER input; anything else throws Node's
|
|
@@ -3036,6 +3156,9 @@ ScrStr *scr_path_win32_to_namespaced_path(ScrStr *path);
|
|
|
3036
3156
|
* The pair behind spawn's fd-stdio form. */
|
|
3037
3157
|
double scr_fs_open(ScrStr *path, ScrStr *flags);
|
|
3038
3158
|
double scr_fs_open_numeric(ScrStr *path, double flags, double mode);
|
|
3159
|
+
/* Engine callers supply the target OS's flags, rather than the frontend's
|
|
3160
|
+
* portable constant mask. Argument validation happens before this seam. */
|
|
3161
|
+
double scr_fs_open_native(ScrStr *path, double flags, double mode);
|
|
3039
3162
|
ScrFileHandle *scr_file_handle_open(ScrStr *path, ScrStr *flags, double mode);
|
|
3040
3163
|
ScrFileHandle *scr_file_handle_retain(ScrFileHandle *h);
|
|
3041
3164
|
void scr_file_handle_release(ScrFileHandle *h);
|
|
@@ -3043,6 +3166,12 @@ void *scr_file_handle_retain_v(void *p);
|
|
|
3043
3166
|
void scr_file_handle_release_v(void *p);
|
|
3044
3167
|
double scr_file_handle_fd(ScrFileHandle *h);
|
|
3045
3168
|
void scr_file_handle_close(ScrFileHandle *h);
|
|
3169
|
+
ScrPromise *scr_file_handle_sync_promise(ScrFileHandle *h);
|
|
3170
|
+
ScrPromise *scr_file_handle_datasync_promise(ScrFileHandle *h);
|
|
3171
|
+
ScrPromise *scr_file_handle_truncate_promise(ScrFileHandle *h, double length);
|
|
3172
|
+
ScrPromise *scr_file_handle_chmod_promise(ScrFileHandle *h, double mode);
|
|
3173
|
+
double scr_file_handle_readv(ScrFileHandle *h, ScrArr *buffers, double position);
|
|
3174
|
+
double scr_file_handle_writev(ScrFileHandle *h, ScrArr *buffers, double position);
|
|
3046
3175
|
double scr_file_handle_read(ScrFileHandle *h, ScrBytes *buf, double offset,
|
|
3047
3176
|
double length, double position, bool length_default);
|
|
3048
3177
|
double scr_file_handle_write_bytes(ScrFileHandle *h, ScrBytes *buf,
|
|
@@ -3066,6 +3195,11 @@ double scr_fs_write_sync(double fd, ScrBytes *buf, double offset, double length,
|
|
|
3066
3195
|
double position);
|
|
3067
3196
|
double scr_fs_write_str_sync(double fd, ScrStr *data, double position,
|
|
3068
3197
|
ScrStr *encoding);
|
|
3198
|
+
double scr_fs_readv_sync(double fd, ScrArr *buffers, double position);
|
|
3199
|
+
double scr_fs_writev_sync(double fd, ScrArr *buffers, double position);
|
|
3200
|
+
/* Unlike scalar readSync's zero-length fast path, a nonempty vector of
|
|
3201
|
+
* empty views still tests the descriptor and positioned-read capability. */
|
|
3202
|
+
double scr_fs_read_zero(double fd, double position);
|
|
3069
3203
|
void scr_fs_close(double fd);
|
|
3070
3204
|
|
|
3071
3205
|
/* ── WHATWG URL (scr_url.c) ──────────────────────────────────────────
|
|
@@ -3084,6 +3218,10 @@ typedef struct ScrUrl ScrUrl;
|
|
|
3084
3218
|
|
|
3085
3219
|
ScrUrl *scr_url_new(ScrStr *input); /* +1, or throws */
|
|
3086
3220
|
ScrUrl *scr_url_new_base(ScrStr *input, ScrStr *base); /* +1, or throws */
|
|
3221
|
+
bool scr_url_can_parse(ScrStr *input);
|
|
3222
|
+
bool scr_url_can_parse_base(ScrStr *input, ScrStr *base);
|
|
3223
|
+
ScrDyn *scr_url_parse(ScrStr *input); /* +1 native URL or null; invalid URLs do not throw */
|
|
3224
|
+
ScrDyn *scr_url_parse_base(ScrStr *input, ScrStr *base);
|
|
3087
3225
|
ScrUrl *scr_url_retain(ScrUrl *u);
|
|
3088
3226
|
void scr_url_release(ScrUrl *u);
|
|
3089
3227
|
void *scr_url_retain_v(void *p);
|
|
@@ -3211,6 +3349,7 @@ ScrBigInt *scr_bigint_shl(ScrBigInt *a, ScrBigInt *count);
|
|
|
3211
3349
|
ScrBigInt *scr_bigint_shr(ScrBigInt *a, ScrBigInt *count);
|
|
3212
3350
|
bool scr_bigint_eq(ScrBigInt *a, ScrBigInt *b);
|
|
3213
3351
|
bool scr_bigint_eq_string(ScrBigInt *a, ScrStr *b); /* StringToBigInt failure is false */
|
|
3352
|
+
double scr_bigint_cmp_string(ScrBigInt *a, ScrStr *b); /* 2 = invalid StringToBigInt */
|
|
3214
3353
|
double scr_bigint_cmp_f64(ScrBigInt *a, ScrBigInt *b); /* -1, 0, 1 */
|
|
3215
3354
|
double scr_bigint_cmp_number(ScrBigInt *a, double b); /* -1, 0, 1; 2 = NaN */
|
|
3216
3355
|
bool scr_bigint_truthy(ScrBigInt *value);
|
|
@@ -3438,6 +3577,8 @@ typedef enum {
|
|
|
3438
3577
|
SCR_DYNH_DATE, /* JavaScript Date with stable native identity */
|
|
3439
3578
|
SCR_DYNH_ITERATOR, /* live native array/string/byte iterator */
|
|
3440
3579
|
SCR_DYNH_CONSOLE, /* stored global console value */
|
|
3580
|
+
SCR_DYNH_SEARCH_PARAMS, /* live WHATWG URLSearchParams */
|
|
3581
|
+
SCR_DYNH_FETCH_REQUEST,
|
|
3441
3582
|
SCR_DYNH_COUNT,
|
|
3442
3583
|
} ScrDynHandleTag;
|
|
3443
3584
|
|
|
@@ -3450,6 +3591,7 @@ typedef struct ScrDynTypedCast {
|
|
|
3450
3591
|
void *ptr;
|
|
3451
3592
|
void *(*retain)(void *);
|
|
3452
3593
|
void (*release)(void *);
|
|
3594
|
+
bool traced;
|
|
3453
3595
|
struct ScrDynTypedCast *next;
|
|
3454
3596
|
} ScrDynTypedCast;
|
|
3455
3597
|
typedef struct ScrJsval ScrJsval; /* opaque island cell (C11 repeat; the
|
|
@@ -3510,7 +3652,7 @@ struct ScrDyn {
|
|
|
3510
3652
|
ScrBigInt *bigint; /* owned (SCR_DYN_BIGINT) */
|
|
3511
3653
|
/* Callbacks keep the optional symbol unit out of symbol-free binaries. */
|
|
3512
3654
|
struct { ScrSym *value; void (*release)(ScrSym *); ScrStr *(*render)(ScrSym *); ScrStr *(*description)(ScrSym *); } symbol;
|
|
3513
|
-
struct { size_t len; size_t cap; ScrDyn **items; struct ScrDyn *properties; bool sealed; bool frozen; } arr; /* owned */
|
|
3655
|
+
struct { size_t len; size_t cap; ScrDyn **items; struct ScrDyn *properties; bool sealed; bool frozen; unsigned char *presence; } arr; /* owned; NULL presence means dense */
|
|
3514
3656
|
struct {
|
|
3515
3657
|
size_t len;
|
|
3516
3658
|
size_t cap;
|
|
@@ -3526,10 +3668,7 @@ struct ScrDyn {
|
|
|
3526
3668
|
/* SCR_DYN_FUNC: the boxed closure (owned) + its call descriptor. `sig`
|
|
3527
3669
|
* and `name` are static compiler-emitted literals (never freed); name
|
|
3528
3670
|
* may be NULL (anonymous — inspect prints [Function (anonymous)]).
|
|
3529
|
-
* The dyn→closure edge is
|
|
3530
|
-
* has no trace header): trial deletion treats it as an external root,
|
|
3531
|
-
* so nothing dangles — a cycle THROUGH a dyn-boxed function is merely
|
|
3532
|
-
* never collected (documented divergence). */
|
|
3671
|
+
* The dyn→closure ownership edge is traced by the cycle collector. */
|
|
3533
3672
|
struct { ScrClosure *clo; ScrDynThunk thunk; const char *sig; const char *name; uint32_t arity; ScrClassObj *class_obj; } fn;
|
|
3534
3673
|
/* Native handles normally keep conservative ownership edges. Sets
|
|
3535
3674
|
* backed by cycle-capable maps expose their edge to the collector.
|
|
@@ -3553,6 +3692,7 @@ struct ScrDyn {
|
|
|
3553
3692
|
ScrDyn *materialized;
|
|
3554
3693
|
ScrDynTypedCast *casts;
|
|
3555
3694
|
bool traced; /* native referent has a cycle header */
|
|
3695
|
+
bool observed; /* native release reports this identity's disposal */
|
|
3556
3696
|
} typed_ref;
|
|
3557
3697
|
/* SCR_DYN_PROMISE: the retained promise. The boundary contract: it
|
|
3558
3698
|
* settles with a dyn payload (SCR_EXC_REF ScrDyn fulfillment or a
|
|
@@ -3618,6 +3758,7 @@ ScrDyn *scr_dyn_obj_keys(const ScrDyn *v);
|
|
|
3618
3758
|
ScrDyn *scr_dyn_for_in_keys(const ScrDyn *v);
|
|
3619
3759
|
/* Snapshot all own string keys of a SCR_DYN_OBJ in JS order. Returns +1. */
|
|
3620
3760
|
ScrDyn *scr_dyn_obj_own_keys(const ScrDyn *v);
|
|
3761
|
+
ScrDyn *scr_dyn_own_keys(const ScrDyn *value);
|
|
3621
3762
|
ScrDyn *scr_dyn_get_own_property_names(const ScrDyn *value);
|
|
3622
3763
|
ScrDyn *scr_dyn_get_own_property_symbols(const ScrDyn *value);
|
|
3623
3764
|
/* Object.hasOwn over a dyn receiver: OBJ member presence, ARR index
|
|
@@ -3631,6 +3772,7 @@ bool scr_dyn_property_is_enumerable(const ScrDyn *value, const ScrStr *key);
|
|
|
3631
3772
|
* and scalar/function/handle sources copy nothing. */
|
|
3632
3773
|
ScrDyn *scr_dyn_assign(ScrDyn *target, const ScrDyn *src);
|
|
3633
3774
|
ScrDyn *scr_dyn_copy_data_properties(ScrDyn *target, const ScrDyn *src);
|
|
3775
|
+
ScrDyn *scr_dyn_object_rest(const ScrDyn *source, const ScrDyn *excluded);
|
|
3634
3776
|
ScrDyn *scr_dyn_copy_property_descriptors(ScrDyn *target, const ScrDyn *src);
|
|
3635
3777
|
/* Variadic Object.assign (the spread-source form): the compiler packs
|
|
3636
3778
|
* every source into one fresh dyn array — pack_push retains a plain
|
|
@@ -3665,9 +3807,12 @@ ScrDyn *scr_dyn_native_set(ScrMap *value); /* borrowed backing, +1 box */
|
|
|
3665
3807
|
bool scr_dyn_native_set_is(const ScrDyn *value);
|
|
3666
3808
|
ScrDyn *scr_dyn_native_map(ScrMap *value); /* borrowed backing, +1 box */
|
|
3667
3809
|
bool scr_dyn_native_map_is(const ScrDyn *value);
|
|
3810
|
+
void scr_regex_reset_last_index(ScrRegex *re, double index);
|
|
3668
3811
|
ScrRegex *scr_regex_new_checked(const ScrDyn *pattern, const ScrDyn *flags);
|
|
3669
3812
|
ScrDyn *scr_dyn_native_url(ScrUrl *value);
|
|
3670
3813
|
bool scr_dyn_native_url_is(const ScrDyn *value);
|
|
3814
|
+
ScrDyn *scr_dyn_native_search_params(ScrSearchParams *value);
|
|
3815
|
+
bool scr_dyn_native_search_params_is(const ScrDyn *value);
|
|
3671
3816
|
bool scr_dyn_native_date_is(const ScrDyn *value);
|
|
3672
3817
|
ScrDyn *scr_dyn_native_date_new(const ScrDyn *arguments);
|
|
3673
3818
|
double scr_dyn_native_date_value(const ScrDyn *value);
|
|
@@ -3681,6 +3826,7 @@ ScrSym *scr_sym_well_known(ScrStr *name);
|
|
|
3681
3826
|
ScrDyn *scr_dyn_symbol_get(const ScrDyn *value, const ScrStr *key);
|
|
3682
3827
|
ScrDyn *scr_dyn_symbol_key_get(const ScrDyn *value, const ScrDyn *key, bool optional);
|
|
3683
3828
|
void scr_dyn_symbol_key_set(ScrDyn *value, ScrDyn *key, ScrDyn *stored);
|
|
3829
|
+
void scr_dyn_symbol_key_placeholder(ScrDyn *value, ScrDyn *key);
|
|
3684
3830
|
bool scr_dyn_has_key_computed(const ScrDyn *value, const ScrDyn *key);
|
|
3685
3831
|
bool scr_dyn_has_own_computed(const ScrDyn *value, const ScrDyn *key);
|
|
3686
3832
|
bool scr_dyn_property_is_enumerable_computed(const ScrDyn *value, const ScrDyn *key);
|
|
@@ -3693,9 +3839,14 @@ ScrDyn *scr_dyn_increment(const ScrDyn *value, bool increment);
|
|
|
3693
3839
|
ScrDyn *scr_dyn_symbol_ref(ScrSym *value, void (*release)(ScrSym *), ScrStr *(*render)(ScrSym *), ScrStr *(*description)(ScrSym *));
|
|
3694
3840
|
ScrDyn *scr_dyn_new_str(ScrStr *s);
|
|
3695
3841
|
ScrDyn *scr_dyn_new_arr(void);
|
|
3842
|
+
ScrDyn *scr_dyn_array_constructor(void);
|
|
3843
|
+
bool scr_dyn_arr_has_index(const ScrDyn *arr, size_t index);
|
|
3844
|
+
void scr_dyn_arr_push_hole(ScrDyn *arr);
|
|
3696
3845
|
ScrDyn *scr_dyn_new_obj(void);
|
|
3697
3846
|
ScrDyn *scr_dyn_iterator(const ScrDyn *value, const ScrStr *spell);
|
|
3847
|
+
ScrDyn *scr_dyn_iterator_optional(const ScrDyn *value);
|
|
3698
3848
|
void scr_dyn_install_iterator_symbol(ScrDyn *key);
|
|
3849
|
+
void scr_dyn_install_async_iterator_symbol(ScrDyn *key);
|
|
3699
3850
|
ScrDyn *scr_dyn_array_values_function(void);
|
|
3700
3851
|
ScrDyn *scr_dyn_array_from_iterator(const ScrDyn *value);
|
|
3701
3852
|
ScrDyn *scr_dyn_iterator_result(ScrDyn *value);
|
|
@@ -3721,6 +3872,7 @@ bool scr_dyn_is_extensible(ScrDyn *object);
|
|
|
3721
3872
|
ScrDyn *scr_dyn_seal(ScrDyn *object);
|
|
3722
3873
|
bool scr_dyn_is_sealed(const ScrDyn *object);
|
|
3723
3874
|
ScrDyn *scr_dyn_proxy_new(const ScrDyn *target, const ScrDyn *handler);
|
|
3875
|
+
bool scr_dyn_is_callable(const ScrDyn *value);
|
|
3724
3876
|
ScrDyn *scr_dyn_proxy_get(const ScrDyn *proxy, const ScrStr *key);
|
|
3725
3877
|
bool scr_dyn_proxy_has(const ScrDyn *proxy, const ScrStr *key);
|
|
3726
3878
|
ScrDyn *scr_dyn_own_descriptor(const ScrDyn *value, const ScrStr *key);
|
|
@@ -3730,6 +3882,11 @@ void scr_dyn_proxy_unsupported(const char *operation);
|
|
|
3730
3882
|
/* Retains the native view, preserving identity and its shared backing
|
|
3731
3883
|
* allocation across the checked-dynamic boundary. Borrows b. */
|
|
3732
3884
|
ScrDyn *scr_dyn_new_bytes(const ScrBytes *b);
|
|
3885
|
+
ScrDyn *scr_bytes_constructor(const ScrStr *name);
|
|
3886
|
+
bool scr_bytes_instanceof(const ScrDyn *value, const ScrDyn *callee);
|
|
3887
|
+
bool scr_dyn_data_view_is(const ScrDyn *value);
|
|
3888
|
+
ScrDyn *scr_dyn_construct(const ScrDyn *callee, const ScrDyn *args, const ScrStr *what);
|
|
3889
|
+
ScrDyn *scr_bytes_construct(const ScrDyn *callee, const ScrDyn *args, const ScrStr *what);
|
|
3733
3890
|
ScrDyn *scr_dyn_bytes_key_get(const ScrDyn *value, const ScrStr *key);
|
|
3734
3891
|
/* The Buffer-flavored twin (stream chunks): string coercion/toString
|
|
3735
3892
|
* decode utf8 instead of joining elements. */
|
|
@@ -3749,6 +3906,11 @@ ScrDyn *scr_dyn_new_typed_ref_traced(
|
|
|
3749
3906
|
const char *type_key, size_t type_key_len,
|
|
3750
3907
|
ScrDyn *(*materialize)(void *),
|
|
3751
3908
|
void (*commit)(void *, const ScrDyn *));
|
|
3909
|
+
ScrDyn *scr_dyn_new_typed_ref_observed(
|
|
3910
|
+
void *ptr, void *(*retain)(void *), void (*release)(void *),
|
|
3911
|
+
const char *type_key, size_t type_key_len,
|
|
3912
|
+
ScrDyn *(*materialize)(void *),
|
|
3913
|
+
void (*commit)(void *, const ScrDyn *));
|
|
3752
3914
|
bool scr_dyn_typed_ref_is(
|
|
3753
3915
|
const ScrDyn *d, const char *type_key, size_t type_key_len);
|
|
3754
3916
|
bool scr_dyn_typed_ref_is_key(const ScrDyn *d, const ScrStr *type_key);
|
|
@@ -3760,11 +3922,12 @@ void *scr_dyn_typed_ref_cached_cast(
|
|
|
3760
3922
|
const ScrDyn *d, const char *type_key, size_t type_key_len); /* +1/NULL */
|
|
3761
3923
|
void scr_dyn_typed_ref_cache_cast(
|
|
3762
3924
|
ScrDyn *d, const char *type_key, size_t type_key_len, void *ptr,
|
|
3763
|
-
void *(*retain)(void *), void (*release)(void *));
|
|
3925
|
+
void *(*retain)(void *), void (*release)(void *), bool traced);
|
|
3764
3926
|
/* Retains a SCR_DYN_BYTES view (+1) for checked extraction. */
|
|
3765
3927
|
ScrBytes *scr_dyn_bytes_unbox(const ScrDyn *d);
|
|
3766
3928
|
/* Exact numeric typed-array brand; elem is a ScrBytesElem tag. */
|
|
3767
3929
|
bool scr_dyn_bytes_is(const ScrDyn *d, int elem);
|
|
3930
|
+
bool scr_dyn_typed_array_is(const ScrDyn *d, int elem);
|
|
3768
3931
|
void scr_dyn_arr_push(ScrDyn *arr, ScrDyn *item);
|
|
3769
3932
|
/* Spread completion for a runtime-arity argument list (`f(...xs)` in the
|
|
3770
3933
|
* checked-dynamic tier): flattens `src` into `arr` per JS's spread over the
|
|
@@ -3780,6 +3943,7 @@ void scr_dyn_arr_push_spread(ScrDyn *arr, const ScrDyn *src, const char *what);
|
|
|
3780
3943
|
* compile-time source spelling), else the runtime kind wording. Borrows
|
|
3781
3944
|
* both; NULL with the exception pending on the throw. */
|
|
3782
3945
|
ScrDyn *scr_dyn_iter_pack(const ScrDyn *src, const ScrStr *msg);
|
|
3946
|
+
ScrDyn *scr_dyn_jsval_iter_n(const ScrDyn *src, double count);
|
|
3783
3947
|
/* Map constructor seeds: retain array inputs for live iteration, accept
|
|
3784
3948
|
* nullish inputs as empty, and validate each entry before reading 0/1. */
|
|
3785
3949
|
ScrDyn *scr_dyn_map_seed_entries(const ScrDyn *src);
|
|
@@ -3834,7 +3998,14 @@ ScrStr *scr_dyn_to_string(const ScrDyn *d, const ScrStr *enc);
|
|
|
3834
3998
|
* null-prototype dictionary throws "<what> is not a function" — its
|
|
3835
3999
|
* prototype chain has no toString (Node's answer). */
|
|
3836
4000
|
ScrStr *scr_dyn_to_string_method(const ScrDyn *d, const ScrStr *enc, const ScrStr *what);
|
|
4001
|
+
ScrDyn *scr_dyn_object_prototype(void);
|
|
4002
|
+
ScrDyn *scr_dyn_function_apply(void);
|
|
4003
|
+
ScrDyn *scr_dyn_reflect_apply(ScrDyn *target, ScrDyn *receiver, ScrDyn *arguments_list);
|
|
4004
|
+
ScrDyn *scr_dyn_apply_array_like(const ScrDyn *target, const ScrDyn *receiver, const ScrDyn *arguments, const char *what);
|
|
4005
|
+
bool scr_dyn_same_value(const ScrDyn *left, const ScrDyn *right);
|
|
4006
|
+
ScrDyn *scr_dyn_builtin_method(const ScrStr *prototype, const ScrStr *method);
|
|
3837
4007
|
ScrStr *scr_dyn_to_string_argument(const ScrDyn *d, const ScrDyn *argument, const ScrStr *what);
|
|
4008
|
+
ScrStr *scr_num_to_string_radix(double value, const ScrDyn *radix);
|
|
3838
4009
|
/* JS String() over the dyn kind (units render "null"/"undefined" where
|
|
3839
4010
|
* scr_dyn_to_string throws) — the web globals' WebIDL ToString. +1. */
|
|
3840
4011
|
ScrStr *scr_dyn_string_coerce(const ScrDyn *d);
|
|
@@ -3847,8 +4018,11 @@ bool scr_dyn_number_coerce_js(const ScrDyn *d, double *out);
|
|
|
3847
4018
|
* with the exception pending when an object hook throws/refuses. */
|
|
3848
4019
|
double scr_dyn_number_coerce(const ScrDyn *d);
|
|
3849
4020
|
double scr_dyn_number_constructor(const ScrDyn *d);
|
|
4021
|
+
ScrBigInt *scr_dyn_bigint_constructor(const ScrDyn *d);
|
|
4022
|
+
ScrBigInt *scr_dyn_bigint_coerce(const ScrDyn *d);
|
|
3850
4023
|
ScrDyn *scr_dyn_add(const ScrDyn *left, const ScrDyn *right); /* borrowed; +1 or NULL/pending */
|
|
3851
4024
|
ScrDyn *scr_dyn_arithmetic(const ScrDyn *left, const ScrDyn *right, const ScrStr *operation);
|
|
4025
|
+
bool scr_dyn_compare(const ScrDyn *left, const ScrDyn *right, const ScrStr *operation);
|
|
3852
4026
|
ScrDyn *scr_dyn_bitwise(const ScrDyn *left, const ScrDyn *right, const ScrStr *operation);
|
|
3853
4027
|
|
|
3854
4028
|
/* `d instanceof TypeError` (and the other builtin error classes) on a
|
|
@@ -3880,6 +4054,9 @@ void scr_sc_validate_options(const ScrDyn *options);
|
|
|
3880
4054
|
/* An %Error as the boundary's dyn shape ({name, message[, code]}).
|
|
3881
4055
|
* Borrows; +1. */
|
|
3882
4056
|
ScrDyn *scr_dyn_from_error(const ScrError *e);
|
|
4057
|
+
void scr_error_register_dyn(const ScrVt *vt, ScrDyn *(*box)(void *));
|
|
4058
|
+
ScrDyn *scr_error_dyn_fields(const ScrError *e);
|
|
4059
|
+
void scr_error_commit_dyn(ScrError *e, const ScrDyn *view);
|
|
3883
4060
|
/* The reverse extraction, riding the same identity cache: a dyn error
|
|
3884
4061
|
* that came from a runtime ScrError answers THAT instance (+1;
|
|
3885
4062
|
* out-and-back crossings compare reference-equal); alien %error objects
|
|
@@ -3904,6 +4081,8 @@ bool scr_dyn_strict_eq(const ScrDyn *a, const ScrDyn *b);
|
|
|
3904
4081
|
* a name the kind's prototype lacks throws Node's "<what> is not a
|
|
3905
4082
|
* function"; OBJ receivers call the own member. recv/args borrowed,
|
|
3906
4083
|
* result owned (+1). MAY THROW (NULL with the exception pending). */
|
|
4084
|
+
ScrDyn *scr_dyn_prepare_method(ScrDyn *recv, const char *method);
|
|
4085
|
+
ScrDyn *scr_dyn_invoke_prepared(ScrDyn *recv, ScrDyn *callee, const char *method, ScrDyn *const *args, size_t argc, const char *what);
|
|
3907
4086
|
ScrDyn *scr_dyn_invoke(ScrDyn *recv, const char *method, ScrDyn *const *args, size_t argc, const char *what);
|
|
3908
4087
|
/* Keyed read on a FUNC node: the own-property table first (defineProperties
|
|
3909
4088
|
* writes land there), then "name" (the box's best-effort static name; ""
|
|
@@ -3917,11 +4096,13 @@ ScrDyn *scr_dyn_fn_get(const ScrDyn *d, const char *key, size_t key_len);
|
|
|
3917
4096
|
* Returns the target (+1, JS's return), or NULL with a pending catchable
|
|
3918
4097
|
* TypeError (non-object target/descriptor — Node's messages). */
|
|
3919
4098
|
ScrDyn *scr_dyn_define_props(ScrDyn *target, ScrDyn *descs);
|
|
4099
|
+
ScrDyn *scr_dyn_define_prototype_props(ScrDyn *target, ScrDyn *descs, ScrDyn *protected_keys);
|
|
3920
4100
|
/* Boxes a closure as a callable dyn value. Ownership of `clo` MOVES in
|
|
3921
4101
|
* (callers retain first when they keep their own reference); `sig`/`name`
|
|
3922
4102
|
* must be static literals (the box never frees them; name may be NULL). */
|
|
3923
4103
|
ScrDyn *scr_dyn_new_func(ScrClosure *clo, ScrDynThunk thunk, uint32_t arity, const char *sig, const char *name);
|
|
3924
4104
|
ScrDyn *scr_dyn_new_class(ScrClassObj *cls, const char *type_key);
|
|
4105
|
+
bool scr_dyn_class_is_key(const ScrDyn *value, const ScrStr *type_key);
|
|
3925
4106
|
bool scr_dyn_class_is(const ScrDyn *value, const char *type_key);
|
|
3926
4107
|
/* Calls a dyn value: a non-function kind throws the catchable TypeError
|
|
3927
4108
|
* "<what> is not a function" (Node's wording — `what` is the call site's
|
|
@@ -3945,8 +4126,12 @@ typedef struct ScrDynPath {
|
|
|
3945
4126
|
const char *key;
|
|
3946
4127
|
size_t index;
|
|
3947
4128
|
} ScrDynPath;
|
|
4129
|
+
ScrSearchParams *scr_dyn_native_search_params_check(const ScrDyn *value, const ScrDynPath *path);
|
|
4130
|
+
ScrSearchParams *scr_sp_new_checked(const ScrDyn *value);
|
|
3948
4131
|
ScrMap *scr_dyn_native_set_check(const ScrDyn *value, const ScrDynPath *path);
|
|
3949
4132
|
ScrMap *scr_dyn_native_map_check(const ScrDyn *value, const ScrDynPath *path);
|
|
4133
|
+
bool scr_dyn_native_collection_is(const ScrDyn *value, int map, const char *type);
|
|
4134
|
+
ScrMap *scr_dyn_native_collection_check(const ScrDyn *value, int map, const char *type, const ScrDynPath *path);
|
|
3950
4135
|
ScrStr *scr_url_checked_to_path(const ScrDyn *value);
|
|
3951
4136
|
ScrUrl *scr_dyn_native_url_check(const ScrDyn *value, const ScrDynPath *path);
|
|
3952
4137
|
ScrRegex *scr_dyn_native_regex_check(const ScrDyn *value, const ScrDynPath *path);
|
|
@@ -3996,7 +4181,10 @@ typedef struct ScrDynHandleOps {
|
|
|
3996
4181
|
/* Immutable native iterables may drain into a fresh array. Mutable or
|
|
3997
4182
|
* effectful iterators need a separate step/close protocol. NULL = not iterable. */
|
|
3998
4183
|
ScrDyn *(*iter_pack)(void *h);
|
|
4184
|
+
/* A live native iterator step; index advances only when a value is emitted. */
|
|
4185
|
+
ScrDyn *(*iter_step)(void *h, double *index, unsigned selection);
|
|
3999
4186
|
} ScrDynHandleOps;
|
|
4187
|
+
ScrDyn *scr_dyn_native_handle_iterator(ScrDyn *source, unsigned selection);
|
|
4000
4188
|
|
|
4001
4189
|
ScrDyn *scr_intl_segmenter_new(void);
|
|
4002
4190
|
ScrStr *scr_process_builtin_id(ScrDyn *id, ScrArr *known);
|
|
@@ -4049,6 +4237,7 @@ ScrDyn *scr_dyn_new_promise_adapting(ScrPromise *src,
|
|
|
4049
4237
|
void (*adapt)(ScrPromise *dst, ScrPromise *src));
|
|
4050
4238
|
/* BORROWED peek at the boxed promise; NULL when d is not a promise box. */
|
|
4051
4239
|
ScrPromise *scr_dyn_promise_of(const ScrDyn *d);
|
|
4240
|
+
ScrPromise *scr_dyn_promise_all(const ScrDyn *entries);
|
|
4052
4241
|
|
|
4053
4242
|
/* ── island values in the checked-dynamic tree (SCR_DYN_JSVAL) ─────────────────────────
|
|
4054
4243
|
* Engine routing ops for JSVAL nodes, installed by the gated constructor
|
|
@@ -4108,6 +4297,7 @@ typedef struct ScrDynJsvalOps {
|
|
|
4108
4297
|
* pending. */
|
|
4109
4298
|
ScrDyn *(*iter_drain)(ScrJsval *cell, bool spread, const ScrStr *spell);
|
|
4110
4299
|
ScrDyn *(*iterator)(ScrJsval *cell, const ScrStr *spell, bool array_from);
|
|
4300
|
+
ScrDyn *(*iter_n)(ScrJsval *cell, double count);
|
|
4111
4301
|
} ScrDynJsvalOps;
|
|
4112
4302
|
|
|
4113
4303
|
/* The allocator view the gated constructor uses (installs the ops);
|
|
@@ -4165,6 +4355,7 @@ void scr_dyn_this_pop(void);
|
|
|
4165
4355
|
* handle whose tag has no installed ops — a unit that fires without its
|
|
4166
4356
|
* dyn half never binds). */
|
|
4167
4357
|
ScrDyn *scr_dyn_this_get(void);
|
|
4358
|
+
ScrDyn *scr_gen_receiver(void);
|
|
4168
4359
|
|
|
4169
4360
|
/* The data-chunk encoding window (setEncoding — scr_json.c's note): the
|
|
4170
4361
|
* firing site opens/closes it around a 'data' pass; scr_dyn_new_chunk
|
|
@@ -4321,6 +4512,8 @@ long scr_obj_live_count(void);
|
|
|
4321
4512
|
* tiebreaks) drives everything after %main returns. See scr_async.c.
|
|
4322
4513
|
*/
|
|
4323
4514
|
ScrPromise *scr_promise_new(void);
|
|
4515
|
+
void scr_promise_share_identity(ScrPromise *dst, ScrPromise *src);
|
|
4516
|
+
bool scr_promise_identity_equal(ScrPromise *a, ScrPromise *b);
|
|
4324
4517
|
ScrPromise *scr_promise_retain(ScrPromise *p);
|
|
4325
4518
|
void scr_promise_release(ScrPromise *p);
|
|
4326
4519
|
void *scr_promise_retain_v(void *p);
|
|
@@ -4373,6 +4566,8 @@ void scr_promise_rethrow_top_level(ScrPromise *p);
|
|
|
4373
4566
|
* payload as a dyn value (+1; void fulfillments answer the undefined
|
|
4374
4567
|
* value), or NULL with the rejection re-thrown into the awaiter. */
|
|
4375
4568
|
ScrDyn *scr_await_dyn(ScrPromise *p);
|
|
4569
|
+
ScrDyn *scr_await_dyn_value_settled(ScrDyn *value);
|
|
4570
|
+
void scr_promise_resolve_dyn(ScrPromise *destination, ScrDyn *value);
|
|
4376
4571
|
/* `await v` over a checked-dynamic VALUE: dyn promises adopt, everything
|
|
4377
4572
|
* else takes JS's one-hop non-thenable await and answers itself (+1). */
|
|
4378
4573
|
ScrDyn *scr_await_dyn_value(ScrDyn *v);
|
|
@@ -4859,6 +5054,11 @@ long scr_promise_live_count(void);
|
|
|
4859
5054
|
* --dynamic the same TU boots the broader engine web surface. The
|
|
4860
5055
|
* emitted main calls scr_fetch_install in either form. */
|
|
4861
5056
|
void scr_fetch_install(void);
|
|
5057
|
+
ScrPromise *scr_fetch_input(ScrDyn *input, ScrDyn *init);
|
|
5058
|
+
ScrDyn *scr_fetch_function(void);
|
|
5059
|
+
void scr_global_fetch_install(ScrDyn *(*get)(void));
|
|
5060
|
+
ScrDyn *scr_fetch_request_new(ScrDyn *input, ScrDyn *init);
|
|
5061
|
+
ScrDyn *scr_fetch_headers_new(ScrDyn *init);
|
|
4862
5062
|
ScrPromise *scr_fetch_static(ScrStr *url, ScrDyn *init); /* +1 promise<Response handle> */
|
|
4863
5063
|
ScrDyn *scr_fetch_response_new(ScrDyn *body, ScrDyn *init); /* borrowed args; +1 Response handle or NULL pending */
|
|
4864
5064
|
ScrPromise *scr_fetch_response_json(ScrDyn *response); /* +1 promise<dyn> */
|
|
@@ -5437,8 +5637,8 @@ double scr_bit_not(double a);
|
|
|
5437
5637
|
* construction (owners point at nothing): never part of a cycle, no
|
|
5438
5638
|
* trace. Element reads widen to double; writes coerce JS-exactly (ToUint8
|
|
5439
5639
|
* / ToUint32 modular truncation, double→float rounding for f32).
|
|
5440
|
-
* Out-of-bounds ELEMENT
|
|
5441
|
-
*
|
|
5640
|
+
* Out-of-bounds typed ELEMENT reads trap like arrays; invalid writes are
|
|
5641
|
+
* ignored as in JavaScript. The Node-shaped operations
|
|
5442
5642
|
* (construction lengths, set(), the read/write numeric families, the
|
|
5443
5643
|
* DataView constructor and getters) THROW catchable RangeErrors exactly
|
|
5444
5644
|
* where Node throws. */
|
|
@@ -5466,6 +5666,7 @@ typedef struct ScrBytes {
|
|
|
5466
5666
|
* points into backing->data — released, never freed. */
|
|
5467
5667
|
struct ScrBytes *backing;
|
|
5468
5668
|
bool is_buffer; /* Buffer brand belongs to the view, not its backing. */
|
|
5669
|
+
bool is_data_view; /* DataView is distinct from a numeric typed array. */
|
|
5469
5670
|
bool external; /* Root aliases foreign memory; releasing it never frees data. */
|
|
5470
5671
|
} ScrBytes;
|
|
5471
5672
|
|
|
@@ -5511,6 +5712,7 @@ ScrBytes *scr_bytes_as_buffer(ScrBytes *bytes); /* borrows; +1, Buffer factory o
|
|
|
5511
5712
|
* byte storage, including when src is itself a subarray. */
|
|
5512
5713
|
ScrBytes *scr_bytes_buffer_view(ScrBytes *src, ScrBytesElem elem,
|
|
5513
5714
|
double offset, bool has_len, double length);
|
|
5715
|
+
ScrDyn *scr_array_buffer_constructor(void);
|
|
5514
5716
|
ScrDyn *scr_array_buffer_new(ScrDyn *length);
|
|
5515
5717
|
ScrDyn *scr_array_buffer_from_bytes(ScrBytes *view);
|
|
5516
5718
|
bool scr_array_buffer_is(const ScrDyn *value);
|
|
@@ -5594,9 +5796,8 @@ double scr_dataview_get(const ScrBytes *b, double byte_off, ScrDataViewGet kind,
|
|
|
5594
5796
|
* with the getters' one RangeError. */
|
|
5595
5797
|
void scr_dataview_set(ScrBytes *b, double byte_off, double value, ScrDataViewGet kind, bool le);
|
|
5596
5798
|
|
|
5597
|
-
/* Element read/write.
|
|
5598
|
-
*
|
|
5599
|
-
* the divergence from JS's undefined-read/ignored-write). Writes coerce
|
|
5799
|
+
/* Element read/write. Invalid typed reads trap; invalid writes are ignored.
|
|
5800
|
+
* Checked reads preserve JavaScript's undefined result. Valid writes coerce
|
|
5600
5801
|
* JS-exactly: u8/u32 by modular truncation (NaN/±Infinity → 0, truncate
|
|
5601
5802
|
* toward zero, wrap mod 2^8/2^32), f32 by double→float rounding. */
|
|
5602
5803
|
double scr_bytes_get(const ScrBytes *b, double i);
|
|
@@ -5673,6 +5874,17 @@ ScrStr *scr_bytes_to_str_checked_range(const ScrBytes *b, const ScrStr *enc, dou
|
|
|
5673
5874
|
* same replacement decode as toString("utf8") with the leading BOM
|
|
5674
5875
|
* stripped. Borrows; +1; never throws. */
|
|
5675
5876
|
ScrStr *scr_text_decode(const ScrBytes *b);
|
|
5877
|
+
double scr_text_decoder_encoding(const ScrDyn *label);
|
|
5878
|
+
ScrStr *scr_text_decoder_name(double encoding);
|
|
5879
|
+
ScrDyn *scr_text_encode_into(const ScrDyn *source, const ScrDyn *destination);
|
|
5880
|
+
bool scr_buffer_is_ascii(const ScrDyn *input);
|
|
5881
|
+
bool scr_buffer_is_utf8(const ScrDyn *input);
|
|
5882
|
+
ScrBytes *scr_buffer_transcode(const ScrDyn *source, const ScrDyn *from, const ScrDyn *to);
|
|
5883
|
+
ScrBytes *scr_bytes_buffer_source(const ScrDyn *value);
|
|
5884
|
+
ScrStr *scr_text_decode_buffer_source(const ScrDyn *value);
|
|
5885
|
+
ScrStr *scr_text_decode_options(const ScrBytes *b, bool fatal, bool ignore_bom);
|
|
5886
|
+
ScrStr *scr_text_decode_stream(ScrDyn *state, const ScrBytes *b, double encoding, bool fatal, bool ignore_bom, bool stream);
|
|
5887
|
+
ScrStr *scr_text_decode_legacy_options(const ScrBytes *b, double encoding, bool fatal, bool ignore_bom);
|
|
5676
5888
|
|
|
5677
5889
|
/* TextDecoder with a compile-time WHATWG legacy-encoding id. The frontend
|
|
5678
5890
|
* owns label canonicalization and emits only the ids understood by
|
|
@@ -5693,6 +5905,7 @@ ScrBytes *scr_bytes_from_str(const ScrStr *s, const ScrStr *enc);
|
|
|
5693
5905
|
* Buffer.isEncoding(name) (case-insensitive over Node's alias set).
|
|
5694
5906
|
* Borrow; never throw. */
|
|
5695
5907
|
double scr_bytes_byte_length_str(ScrStr *s, const ScrStr *enc);
|
|
5908
|
+
double scr_buffer_byte_length_dyn(ScrDyn *value, ScrStr *enc);
|
|
5696
5909
|
bool scr_bytes_is_encoding(const ScrStr *s);
|
|
5697
5910
|
|
|
5698
5911
|
/* equals / compare / indexOf-lastIndexOf / fill / copy / swap / write on
|
|
@@ -5868,6 +6081,8 @@ ScrBytes *scr_fs_read_file_bytes(ScrStr *path); /* +1 */
|
|
|
5868
6081
|
* value — a Buffer box for undefined/null, a string for utf8 — or NULL
|
|
5869
6082
|
* with the exception pending. */
|
|
5870
6083
|
ScrDyn *scr_fs_read_file_sync_dyn(ScrStr *path, const ScrDyn *enc);
|
|
6084
|
+
ScrDyn *scr_fs_callback_value(ScrStr *member);
|
|
6085
|
+
ScrDyn *scr_fs_callback_call(ScrStr *member, const ScrDyn *args);
|
|
5871
6086
|
ScrBytes *scr_fs_read_fd_bytes(double fd); /* +1; the fd form (scr_lib.c) */
|
|
5872
6087
|
void scr_fs_write_file_bytes(ScrStr *path, const ScrBytes *data);
|
|
5873
6088
|
void scr_fs_append_file_bytes(ScrStr *path, const ScrBytes *data);
|
|
@@ -7163,10 +7378,8 @@ void scr_assert_iferror_bool(bool b);
|
|
|
7163
7378
|
* %error-marked objects throw with the error's message, everything else
|
|
7164
7379
|
* with the inspection. */
|
|
7165
7380
|
void scr_assert_iferror_dyn(const ScrDyn *v);
|
|
7166
|
-
/* assert.match / assert.doesNotMatch (scr_regex.c):
|
|
7167
|
-
*
|
|
7168
|
-
* modeled (SEMANTICS.md's regex stance), so g/y-flagged regexes test like
|
|
7169
|
-
* their flag-free twins instead of aborting. */
|
|
7381
|
+
/* assert.match / assert.doesNotMatch (scr_regex.c): RegExp.test semantics,
|
|
7382
|
+
* including global/sticky lastIndex transitions. */
|
|
7170
7383
|
void scr_assert_match(ScrStr *s, ScrRegex *re, bool negated, ScrStr *msg, bool has_msg);
|
|
7171
7384
|
/* assert.throws(fn, /regex/) whose thrown ERROR did not match: Node tests
|
|
7172
7385
|
* String(actual) ("Name: message") and reports the regex-mismatch message
|
|
@@ -7204,4 +7417,7 @@ void scr_console_log(size_t n, const ScrLogArg *args);
|
|
|
7204
7417
|
* keeps source order. */
|
|
7205
7418
|
void scr_console_error(size_t n, const ScrLogArg *args);
|
|
7206
7419
|
|
|
7420
|
+
bool scr_fetch_web_is(const ScrDyn *value, const ScrStr *name);
|
|
7421
|
+
bool scr_fetch_stream_is(const ScrDyn *value);
|
|
7422
|
+
|
|
7207
7423
|
#endif /* SCR_RUNTIME_H */
|