@scriptc/cli-darwin-x64 0.2.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/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 +25 -15
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +1 -1
- 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_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_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_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_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_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_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_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_object.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_url.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_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_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_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_exception.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_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_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_node_builtin.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_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_url.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_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_console_native.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_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_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_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_object.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_url.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_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_console_native.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_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_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_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_object.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_url.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_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_console_native.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_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_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_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_object.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_url.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_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_console_native.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_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_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_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_object.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_url.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/v8-number-radix.txt +61 -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_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_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_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_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_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_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_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_object.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_url.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_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_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_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_exception.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_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_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_node_builtin.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_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_url.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/package.json +1 -1
- package/dist/lib/runtime-darwin-x64/runtime-pack.json +529 -525
- package/dist/lib/runtime-sources/package.json +1 -1
- 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 +26 -1
- package/dist/lib/runtime-sources/src/scr_async_dyn.c +90 -16
- package/dist/lib/runtime-sources/src/scr_bigint.c +8 -0
- package/dist/lib/runtime-sources/src/scr_bytes.c +205 -41
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +581 -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_dyn_invoke.c +164 -31
- 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 +266 -2
- package/dist/lib/runtime-sources/src/scr_http.c +3 -0
- package/dist/lib/runtime-sources/src/scr_island.c +38 -13
- package/dist/lib/runtime-sources/src/scr_json.c +1149 -91
- 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_regex.c +108 -69
- package/dist/lib/runtime-sources/src/scr_runtime.h +190 -33
- 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 +172 -3
- package/dist/lib/runtime-sources/vendor/v8-number-radix/LICENSE +61 -0
- package/package.json +1 -1
|
@@ -555,7 +555,15 @@ static bool dyn_name_is(const char *m, const char *n) { return strcmp(m, n) == 0
|
|
|
555
555
|
* accessor reports). */
|
|
556
556
|
static ScrDyn *scr_dynh_dispatch(ScrDyn *recv, const char *method, ScrDyn *const *args, size_t argc, const char *what) {
|
|
557
557
|
const ScrDynHandleOps *ops = scr_dyn_handle_ops_of(recv);
|
|
558
|
-
return ops->invoke(recv->v.handle.ptr, recv, method, args, argc, what);
|
|
558
|
+
if (ops->invoke) return ops->invoke(recv->v.handle.ptr, recv, method, args, argc, what);
|
|
559
|
+
ScrDyn *callable = ops->get ? ops->get(recv->v.handle.ptr, method, strlen(method)) : NULL;
|
|
560
|
+
if (scr_exc_pending()) { scr_dyn_release(callable); return NULL; }
|
|
561
|
+
if (!callable) callable = scr_dyn_retain(scr_dyn_undefined());
|
|
562
|
+
scr_dyn_this_push_dyn(recv);
|
|
563
|
+
ScrDyn *result = scr_dyn_call(callable, args, argc, what);
|
|
564
|
+
scr_dyn_this_pop();
|
|
565
|
+
scr_dyn_release(callable);
|
|
566
|
+
return result;
|
|
559
567
|
}
|
|
560
568
|
|
|
561
569
|
/* JS Array.prototype.sort over a dyn array: the spec's snapshot-sort —
|
|
@@ -648,6 +656,14 @@ static bool dyn_arr_flatten(ScrDyn *out, const ScrDyn *source, double depth, siz
|
|
|
648
656
|
return false;
|
|
649
657
|
}
|
|
650
658
|
const ScrDyn *item = source->v.arr.items[i];
|
|
659
|
+
if (depth > 0 && item->kind == SCR_DYN_TYPED_REF && scr_dyn_isl_is_array(item)) {
|
|
660
|
+
ScrDyn *view = scr_dyn_typed_ref_materialize(item);
|
|
661
|
+
if (!view || scr_exc_pending()) { scr_dyn_release(view); return false; }
|
|
662
|
+
bool ok = dyn_arr_flatten(out, view, depth - 1, visits);
|
|
663
|
+
scr_dyn_release(view);
|
|
664
|
+
if (!ok) return false;
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
651
667
|
if (depth > 0 && item->kind == SCR_DYN_ARR) {
|
|
652
668
|
if (!dyn_arr_flatten(out, item, depth - 1, visits)) return false;
|
|
653
669
|
} else {
|
|
@@ -690,6 +706,29 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
690
706
|
ScrDyn *recv, const char *method, ScrDyn *const *args, size_t argc,
|
|
691
707
|
const char *what, ScrDyn *callback_recv);
|
|
692
708
|
|
|
709
|
+
ScrDyn *scr_dyn_prepare_method(ScrDyn *recv, const char *method) {
|
|
710
|
+
if (recv->kind == SCR_DYN_UNDEF || recv->kind == SCR_DYN_NULL)
|
|
711
|
+
return scr_dyn_invoke(recv, method, NULL, 0, method);
|
|
712
|
+
if (recv->kind == SCR_DYN_OBJ)
|
|
713
|
+
return scr_dyn_obj_read(recv, method, strlen(method));
|
|
714
|
+
if (recv->kind == SCR_DYN_PROXY) {
|
|
715
|
+
ScrStr *key = scr_str_new(method, strlen(method));
|
|
716
|
+
ScrDyn *result = scr_dyn_proxy_get(recv, key);
|
|
717
|
+
scr_str_release(key);
|
|
718
|
+
return result;
|
|
719
|
+
}
|
|
720
|
+
return NULL;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
ScrDyn *scr_dyn_invoke_prepared(ScrDyn *recv, ScrDyn *callee, const char *method,
|
|
724
|
+
ScrDyn *const *args, size_t argc, const char *what) {
|
|
725
|
+
if (!callee) return scr_dyn_invoke(recv, method, args, argc, what);
|
|
726
|
+
scr_dyn_this_push_dyn(recv);
|
|
727
|
+
ScrDyn *result = scr_dyn_call(callee, args, argc, what);
|
|
728
|
+
scr_dyn_this_pop();
|
|
729
|
+
return result;
|
|
730
|
+
}
|
|
731
|
+
|
|
693
732
|
ScrDyn *scr_dyn_invoke(ScrDyn *recv, const char *method,
|
|
694
733
|
ScrDyn *const *args, size_t argc,
|
|
695
734
|
const char *what) {
|
|
@@ -788,32 +827,8 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
788
827
|
|
|
789
828
|
if (recv->kind == SCR_DYN_FUNC) {
|
|
790
829
|
if (dyn_name_is(method, "apply")) {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
* arguments)` forwards whatever receiver the wrapper ran under). */
|
|
794
|
-
const ScrDyn *thisv = argc >= 1 ? args[0] : scr_dyn_undefined();
|
|
795
|
-
ScrDyn *list = argc >= 2 ? args[1] : NULL;
|
|
796
|
-
if (list == NULL || list->kind == SCR_DYN_UNDEF || list->kind == SCR_DYN_NULL) {
|
|
797
|
-
scr_dyn_this_push_dyn(thisv);
|
|
798
|
-
ScrDyn *r = scr_dyn_call(recv, NULL, 0, what);
|
|
799
|
-
scr_dyn_this_pop();
|
|
800
|
-
return r;
|
|
801
|
-
}
|
|
802
|
-
ScrDyn *view = list->kind == SCR_DYN_TYPED_REF && scr_dyn_isl_is_array(list)
|
|
803
|
-
? scr_dyn_typed_ref_materialize(list) : NULL;
|
|
804
|
-
if (scr_exc_pending()) { scr_dyn_release(view); return NULL; }
|
|
805
|
-
if (view) list = view;
|
|
806
|
-
if (list->kind != SCR_DYN_ARR) {
|
|
807
|
-
scr_throw_error_msg(SCR_ERR_TYPE, "CreateListFromArrayLike called on non-object",
|
|
808
|
-
strlen("CreateListFromArrayLike called on non-object"));
|
|
809
|
-
scr_dyn_release(view);
|
|
810
|
-
return NULL;
|
|
811
|
-
}
|
|
812
|
-
scr_dyn_this_push_dyn(thisv);
|
|
813
|
-
ScrDyn *r = scr_dyn_call(recv, list->v.arr.items, list->v.arr.len, what);
|
|
814
|
-
scr_dyn_this_pop();
|
|
815
|
-
scr_dyn_release(view);
|
|
816
|
-
return r;
|
|
830
|
+
return scr_dyn_apply_array_like(recv, argc ? args[0] : scr_dyn_undefined(),
|
|
831
|
+
argc > 1 ? args[1] : scr_dyn_undefined(), what);
|
|
817
832
|
}
|
|
818
833
|
if (dyn_name_is(method, "call")) {
|
|
819
834
|
scr_dyn_this_push_dyn(argc >= 1 ? args[0] : scr_dyn_undefined());
|
|
@@ -823,6 +838,15 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
823
838
|
}
|
|
824
839
|
if (dyn_name_is(method, "bind")) return scr_dyn_bind(recv, args, argc);
|
|
825
840
|
if (dyn_name_is(method, "toString")) {
|
|
841
|
+
ScrDyn *member = scr_dyn_fn_get(recv, method, strlen(method));
|
|
842
|
+
if (member && member->kind != SCR_DYN_UNDEF) {
|
|
843
|
+
scr_dyn_this_push_dyn(recv);
|
|
844
|
+
ScrDyn *result = scr_dyn_call(member, args, argc, what);
|
|
845
|
+
scr_dyn_this_pop();
|
|
846
|
+
scr_dyn_release(member);
|
|
847
|
+
return result;
|
|
848
|
+
}
|
|
849
|
+
scr_dyn_release(member);
|
|
826
850
|
dyn_throw_unsupported("Function", method);
|
|
827
851
|
return NULL;
|
|
828
852
|
}
|
|
@@ -868,9 +892,11 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
868
892
|
if ((dyn_name_is(method, "indexOf") || dyn_name_is(method, "lastIndexOf") ||
|
|
869
893
|
dyn_name_is(method, "includes")) &&
|
|
870
894
|
argc >= 1 && args[0]->kind == SCR_DYN_STR) {
|
|
871
|
-
|
|
872
|
-
if (
|
|
873
|
-
return
|
|
895
|
+
double position = dyn_index_arg(args, argc, 1, dyn_name_is(method, "lastIndexOf") ? INFINITY : 0, what);
|
|
896
|
+
if (scr_exc_pending()) return NULL;
|
|
897
|
+
if (dyn_name_is(method, "includes")) return scr_dyn_new_bool(scr_str_index_of(s, args[0]->v.str, position) >= 0);
|
|
898
|
+
if (dyn_name_is(method, "indexOf")) return scr_dyn_new_num(scr_str_index_of(s, args[0]->v.str, position));
|
|
899
|
+
return scr_dyn_new_num(scr_str_last_index_of_from(s, args[0]->v.str, position));
|
|
874
900
|
}
|
|
875
901
|
dyn_throw_unsupported("String", method);
|
|
876
902
|
return NULL;
|
|
@@ -1030,7 +1056,7 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
1030
1056
|
ScrDyn *needle = argc > 0 ? args[0] : scr_dyn_undefined();
|
|
1031
1057
|
double from = dyn_name_is(method, "lastIndexOf") ? (double)len - 1 : 0;
|
|
1032
1058
|
if (argc > 1) {
|
|
1033
|
-
from = dyn_index_arg(args, argc, 1,
|
|
1059
|
+
from = dyn_index_arg(args, argc, 1, 0, what);
|
|
1034
1060
|
if (scr_exc_pending()) return NULL;
|
|
1035
1061
|
}
|
|
1036
1062
|
if (!dyn_arr_length_unchanged(recv, len)) return NULL;
|
|
@@ -1309,6 +1335,12 @@ static ScrDyn *scr_dyn_invoke_impl(
|
|
|
1309
1335
|
cb, item, i, callback_recv ? callback_recv : recv);
|
|
1310
1336
|
scr_dyn_release(item);
|
|
1311
1337
|
if (!r) { scr_dyn_release(out); return NULL; }
|
|
1338
|
+
if (r->kind == SCR_DYN_TYPED_REF && scr_dyn_isl_is_array(r)) {
|
|
1339
|
+
ScrDyn *view = scr_dyn_typed_ref_materialize(r);
|
|
1340
|
+
scr_dyn_release(r);
|
|
1341
|
+
r = view;
|
|
1342
|
+
if (!r) { scr_dyn_release(out); return NULL; }
|
|
1343
|
+
}
|
|
1312
1344
|
if (r->kind == SCR_DYN_ARR) {
|
|
1313
1345
|
for (size_t j = 0; j < r->v.arr.len; j++) {
|
|
1314
1346
|
scr_dyn_arr_push(out, scr_dyn_retain(r->v.arr.items[j]));
|
|
@@ -1487,6 +1519,107 @@ static ScrDyn *dyn_array_method_value_call(ScrClosure *closure, ScrDyn *const *a
|
|
|
1487
1519
|
return result;
|
|
1488
1520
|
}
|
|
1489
1521
|
|
|
1522
|
+
static SCR_TL ScrDyn *dyn_builtin_methods;
|
|
1523
|
+
|
|
1524
|
+
static void dyn_builtin_methods_cleanup(void) {
|
|
1525
|
+
scr_dyn_release(dyn_builtin_methods);
|
|
1526
|
+
dyn_builtin_methods = NULL;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
static ScrDyn *dyn_builtin_method_call(ScrClosure *closure, ScrDyn *const *args, size_t argc) {
|
|
1530
|
+
ScrStr *prototype = scr_box_get_ref(closure->caps[0]);
|
|
1531
|
+
ScrStr *method = scr_box_get_ref(closure->caps[1]);
|
|
1532
|
+
ScrDyn *receiver = scr_dyn_this_get();
|
|
1533
|
+
ScrDyn *result = NULL;
|
|
1534
|
+
if (!strcmp(prototype->data, "Object")) {
|
|
1535
|
+
ScrDyn *key = argc ? args[0] : scr_dyn_undefined();
|
|
1536
|
+
if (!strcmp(method->data, "toString")) {
|
|
1537
|
+
ScrStr *tag = scr_dyn_object_tag(receiver);
|
|
1538
|
+
if (tag) { result = scr_dyn_new_str(tag); scr_str_release(tag); }
|
|
1539
|
+
} else if (!strcmp(method->data, "hasOwnProperty")) {
|
|
1540
|
+
bool own = scr_dyn_has_own_computed(receiver, key);
|
|
1541
|
+
if (!scr_exc_pending()) result = scr_dyn_new_bool(own);
|
|
1542
|
+
} else if (!strcmp(method->data, "propertyIsEnumerable")) {
|
|
1543
|
+
bool enumerable = scr_dyn_property_is_enumerable_computed(receiver, key);
|
|
1544
|
+
if (!scr_exc_pending()) result = scr_dyn_new_bool(enumerable);
|
|
1545
|
+
} else if (receiver->kind == SCR_DYN_NULL || receiver->kind == SCR_DYN_UNDEF) {
|
|
1546
|
+
static const char message[] = "Cannot convert undefined or null to object";
|
|
1547
|
+
scr_throw_error_msg(SCR_ERR_TYPE, message, sizeof message - 1);
|
|
1548
|
+
} else if (receiver->kind == SCR_DYN_OBJ || receiver->kind == SCR_DYN_ARR ||
|
|
1549
|
+
receiver->kind == SCR_DYN_FUNC || receiver->kind == SCR_DYN_HANDLE ||
|
|
1550
|
+
receiver->kind == SCR_DYN_TYPED_REF || receiver->kind == SCR_DYN_PROXY) result = scr_dyn_retain(receiver);
|
|
1551
|
+
else dyn_throw_unsupported("Object", method->data);
|
|
1552
|
+
} else {
|
|
1553
|
+
bool compatible = false;
|
|
1554
|
+
if (!strcmp(prototype->data, "String")) compatible = receiver->kind != SCR_DYN_UNDEF && receiver->kind != SCR_DYN_NULL;
|
|
1555
|
+
else if (!strcmp(prototype->data, "Number")) compatible = receiver->kind == SCR_DYN_NUM;
|
|
1556
|
+
else if (receiver->kind == SCR_DYN_HANDLE) {
|
|
1557
|
+
const ScrDynHandleOps *ops = scr_dyn_handle_ops_of(receiver);
|
|
1558
|
+
compatible = !strcmp(ops->cls, prototype->data);
|
|
1559
|
+
}
|
|
1560
|
+
if (!compatible) {
|
|
1561
|
+
static const char message[] = "Builtin prototype method called on incompatible receiver";
|
|
1562
|
+
scr_throw_error_msg(SCR_ERR_TYPE, message, sizeof message - 1);
|
|
1563
|
+
} else if (!strcmp(method->data, "toString") && receiver->kind == SCR_DYN_NUM) {
|
|
1564
|
+
ScrStr *value = scr_dyn_to_string_argument(receiver, argc ? args[0] : scr_dyn_undefined(), method);
|
|
1565
|
+
if (value) { result = scr_dyn_new_str(value); scr_str_release(value); }
|
|
1566
|
+
} else if (!strcmp(prototype->data, "String")) {
|
|
1567
|
+
bool strict = !strcmp(method->data, "toString") || !strcmp(method->data, "valueOf");
|
|
1568
|
+
if (strict && receiver->kind != SCR_DYN_STR) {
|
|
1569
|
+
static const char message[] = "String.prototype method requires a string receiver";
|
|
1570
|
+
scr_throw_error_msg(SCR_ERR_TYPE, message, sizeof message - 1);
|
|
1571
|
+
} else if (strict) result = scr_dyn_retain(receiver);
|
|
1572
|
+
else {
|
|
1573
|
+
ScrStr *text = scr_dyn_string_coerce_js(receiver);
|
|
1574
|
+
if (text) {
|
|
1575
|
+
ScrDyn *string = scr_dyn_new_str(text);
|
|
1576
|
+
scr_str_release(text);
|
|
1577
|
+
if (!strcmp(method->data, "slice")) result = scr_dyn_invoke(string, method->data, args, argc, method->data);
|
|
1578
|
+
else dyn_throw_unsupported("String", method->data);
|
|
1579
|
+
scr_dyn_release(string);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
} else result = scr_dyn_invoke(receiver, method->data, args, argc, method->data);
|
|
1583
|
+
}
|
|
1584
|
+
scr_dyn_release(receiver);
|
|
1585
|
+
scr_str_release(prototype);
|
|
1586
|
+
scr_str_release(method);
|
|
1587
|
+
return result;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
ScrDyn *scr_dyn_builtin_method(const ScrStr *prototype, const ScrStr *method) {
|
|
1591
|
+
if (!dyn_builtin_methods) {
|
|
1592
|
+
dyn_builtin_methods = scr_dyn_new_obj_null_proto();
|
|
1593
|
+
scr_atexit(dyn_builtin_methods_cleanup);
|
|
1594
|
+
}
|
|
1595
|
+
ScrJsonBuf buffer;
|
|
1596
|
+
scr_jb_init(&buffer);
|
|
1597
|
+
scr_jb_puts(&buffer, prototype->data);
|
|
1598
|
+
scr_jb_putc(&buffer, '.');
|
|
1599
|
+
scr_jb_puts(&buffer, method->data);
|
|
1600
|
+
ScrStr *key = scr_jb_finish(&buffer);
|
|
1601
|
+
ScrDyn *value = scr_dyn_obj_get(dyn_builtin_methods, key->data, key->len);
|
|
1602
|
+
if (!value) {
|
|
1603
|
+
ScrClosure *closure = scr_closure_new(NULL, 2);
|
|
1604
|
+
closure->caps[0] = scr_box_new(SCR_BOX_STR);
|
|
1605
|
+
closure->caps[1] = scr_box_new(SCR_BOX_STR);
|
|
1606
|
+
scr_box_set_ref(closure->caps[0], scr_str_retain((ScrStr *)prototype));
|
|
1607
|
+
scr_box_set_ref(closure->caps[1], scr_str_retain((ScrStr *)method));
|
|
1608
|
+
size_t arity = (!strcmp(method->data, "set") || !strcmp(method->data, "substring") ||
|
|
1609
|
+
!strcmp(method->data, "slice") ||
|
|
1610
|
+
!strcmp(method->data, "replace") || !strcmp(method->data, "split")) ? 2 :
|
|
1611
|
+
(!strcmp(method->data, "get") || !strcmp(method->data, "add") || !strcmp(method->data, "has") ||
|
|
1612
|
+
!strcmp(method->data, "delete") || !strcmp(method->data, "forEach") || !strcmp(method->data, "startsWith") ||
|
|
1613
|
+
!strcmp(method->data, "endsWith") || !strcmp(method->data, "padStart") || !strcmp(method->data, "toJSON") ||
|
|
1614
|
+
!strcmp(method->data, "charCodeAt") || !strcmp(method->data, "hasOwnProperty") ||
|
|
1615
|
+
!strcmp(method->data, "propertyIsEnumerable") || (!strcmp(prototype->data, "Number") && !strcmp(method->data, "toString"))) ? 1 : 0;
|
|
1616
|
+
value = scr_dyn_new_func(closure, dyn_builtin_method_call, arity, "native:prototype", method->data);
|
|
1617
|
+
scr_dyn_obj_set(dyn_builtin_methods, key->data, key->len, value);
|
|
1618
|
+
}
|
|
1619
|
+
scr_str_release(key);
|
|
1620
|
+
return scr_dyn_retain(value);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1490
1623
|
ScrDyn *scr_dyn_array_prototype(void) {
|
|
1491
1624
|
static SCR_TL bool initialized;
|
|
1492
1625
|
ScrDyn *prototype = scr_dyn_array_prototype_base();
|
|
@@ -135,6 +135,7 @@ void scr_error_init(void *obj, int kind, ScrStr *message) {
|
|
|
135
135
|
const char *n = scr_error_names[kind];
|
|
136
136
|
e->name = scr_str_new(n, strlen(n));
|
|
137
137
|
e->message = message ? scr_str_retain(message) : scr_str_new("", 0);
|
|
138
|
+
e->message_present = message != NULL;
|
|
138
139
|
e->stack_frames = scr_stack_capture();
|
|
139
140
|
}
|
|
140
141
|
|
|
@@ -172,9 +173,28 @@ ScrError *scr_error_new(int kind, ScrStr *message) {
|
|
|
172
173
|
return e;
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
ScrStr *
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
static SCR_TL ScrStr *(*scr_error_message_reader)(ScrError *);
|
|
177
|
+
static SCR_TL ScrStr *(*scr_error_name_reader)(ScrError *);
|
|
178
|
+
|
|
179
|
+
void scr_error_install_message_reader(ScrStr *(*reader)(ScrError *)) {
|
|
180
|
+
scr_error_message_reader = reader;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void scr_error_install_name_reader(ScrStr *(*reader)(ScrError *)) {
|
|
184
|
+
scr_error_name_reader = reader;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
ScrStr *scr_error_default_name(const ScrError *e) {
|
|
188
|
+
for (int i = 1; i < SCR_ERR_COUNT; i++) {
|
|
189
|
+
if (i == SCR_ERR_DOMEX) continue;
|
|
190
|
+
if (scr_error_vts[i].pre <= e->vt->pre && e->vt->pre <= scr_error_vts[i].post)
|
|
191
|
+
return scr_str_new(scr_error_names[i], strlen(scr_error_names[i]));
|
|
192
|
+
}
|
|
193
|
+
return scr_str_new("Error", 5);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static ScrStr *scr_error_format(ScrError *e, ScrStr *name, ScrStr *message) {
|
|
197
|
+
/* ECMA-262 Error.prototype.toString over the resolved properties — except Node's
|
|
178
198
|
* OWN error classes: AssertionError's toString and the NodeError
|
|
179
199
|
* family's construction-time name both render "name [code]: message".
|
|
180
200
|
* Every ERR_*-coded error this runtime mints IS one of those classes
|
|
@@ -182,8 +202,6 @@ ScrStr *scr_error_to_string(ScrError *e) {
|
|
|
182
202
|
* the code-prefix test is exact for runtime-thrown errors; a user
|
|
183
203
|
* assigning an ERR_* code onto a plain Error would bracket here where
|
|
184
204
|
* Node would not (documented — user code owns that spelling). */
|
|
185
|
-
ScrStr *name = e->name;
|
|
186
|
-
ScrStr *message = e->message;
|
|
187
205
|
bool assertion = name && e->code && e->code->len >= 4 &&
|
|
188
206
|
memcmp(e->code->data, "ERR_", 4) == 0;
|
|
189
207
|
if (!name || name->len == 0) {
|
|
@@ -214,9 +232,36 @@ ScrStr *scr_error_to_string(ScrError *e) {
|
|
|
214
232
|
return out;
|
|
215
233
|
}
|
|
216
234
|
|
|
235
|
+
ScrStr *scr_error_to_string(ScrError *e) {
|
|
236
|
+
// Diagnostic formatting can run with the original error still pending.
|
|
237
|
+
// Accessors execute with a clear cell, and cannot replace that error.
|
|
238
|
+
ScrCaught *pending = scr_exc_pending() ? scr_exc_take() : NULL;
|
|
239
|
+
ScrStr *name = !e->name_present && scr_error_name_reader
|
|
240
|
+
? scr_error_name_reader(scr_error_retain(e)) : scr_str_retain(e->name);
|
|
241
|
+
ScrStr *message = scr_exc_pending() ? NULL : !e->message_present && scr_error_message_reader
|
|
242
|
+
? scr_error_message_reader(scr_error_retain(e)) : scr_str_retain(e->message);
|
|
243
|
+
if (pending) {
|
|
244
|
+
if (scr_exc_pending()) {
|
|
245
|
+
scr_exc_clear();
|
|
246
|
+
scr_str_release(message);
|
|
247
|
+
message = scr_str_retain(e->message);
|
|
248
|
+
scr_str_release(name);
|
|
249
|
+
name = scr_str_retain(e->name);
|
|
250
|
+
}
|
|
251
|
+
scr_rethrow(pending);
|
|
252
|
+
scr_caught_release(pending);
|
|
253
|
+
}
|
|
254
|
+
if (!name || !message) { scr_str_release(name); scr_str_release(message); return NULL; }
|
|
255
|
+
ScrStr *result = scr_error_format(e, name, message);
|
|
256
|
+
scr_str_release(name);
|
|
257
|
+
scr_str_release(message);
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
260
|
+
|
|
217
261
|
ScrStr *scr_error_stack(ScrError *e) {
|
|
218
262
|
if (!e->stack) {
|
|
219
263
|
ScrStr *heading = scr_error_to_string(e);
|
|
264
|
+
if (!heading) return NULL;
|
|
220
265
|
e->stack = e->stack_frames ? scr_str_concat(heading, e->stack_frames) : scr_str_retain(heading);
|
|
221
266
|
scr_str_release(heading);
|
|
222
267
|
}
|
|
@@ -367,6 +412,8 @@ void scr_throw_error_named(ScrStr *name, ScrStr *message) {
|
|
|
367
412
|
ScrError *e = scr_error_alloc(kind);
|
|
368
413
|
e->name = name; /* ownership moves in (engine names may be custom) */
|
|
369
414
|
e->message = message; /* ownership moves in */
|
|
415
|
+
e->name_present = kind == SCR_ERR_ERROR && !(name->len == 5 && memcmp(name->data, "Error", 5) == 0);
|
|
416
|
+
e->message_present = true;
|
|
370
417
|
scr_throw_obj(e, &scr_error_retain_v, &scr_error_release_v,
|
|
371
418
|
scr_error_traced ? &scr_error_trace : NULL);
|
|
372
419
|
}
|
|
@@ -139,11 +139,24 @@ void scr_exc_clear(void) { scr_exc_reset(); }
|
|
|
139
139
|
|
|
140
140
|
/* ── catch bindings (ScrCaught — contract in scr_runtime.h) ──────────── */
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
ScrCaught *c =
|
|
144
|
-
if (
|
|
145
|
-
|
|
142
|
+
void scr_caught_trace_v(void *object, ScrTraceVisit visit, void *ctx) {
|
|
143
|
+
ScrCaught *c = object;
|
|
144
|
+
if (c->payload && c->trace_fn) visit(c->payload, ctx);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static void scr_caught_gcfree(void *object) {
|
|
148
|
+
ScrCaught *c = object;
|
|
149
|
+
if (c->kind == SCR_EXC_STR) {
|
|
150
|
+
scr_str_release((ScrStr *)c->payload);
|
|
151
|
+
} else if (c->payload && c->release_fn && !c->trace_fn) {
|
|
152
|
+
c->release_fn(c->payload);
|
|
146
153
|
}
|
|
154
|
+
scr_obj_free_note();
|
|
155
|
+
scr_cyc_free(c);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
ScrCaught *scr_exc_take(void) {
|
|
159
|
+
ScrCaught *c = scr_cyc_alloc(sizeof *c, scr_caught_trace_v, scr_caught_gcfree);
|
|
147
160
|
c->rc = 1;
|
|
148
161
|
c->kind = scr_exc_kind;
|
|
149
162
|
c->f64 = scr_exc_f64;
|
|
@@ -169,6 +182,7 @@ ScrCaught *scr_caught_retain(ScrCaught *c) {
|
|
|
169
182
|
void scr_caught_release(ScrCaught *c) {
|
|
170
183
|
if (!c) return;
|
|
171
184
|
if (--c->rc == 0) {
|
|
185
|
+
scr_cyc_on_dead(c);
|
|
172
186
|
if (c->kind == SCR_EXC_STR) {
|
|
173
187
|
scr_str_release((ScrStr *)c->payload);
|
|
174
188
|
} else if (c->kind == SCR_EXC_REF || c->kind == SCR_EXC_OBJ ||
|
|
@@ -176,7 +190,9 @@ void scr_caught_release(ScrCaught *c) {
|
|
|
176
190
|
c->release_fn(c->payload);
|
|
177
191
|
}
|
|
178
192
|
scr_obj_free_note();
|
|
179
|
-
|
|
193
|
+
scr_cyc_free(c);
|
|
194
|
+
} else {
|
|
195
|
+
scr_cyc_on_release(c);
|
|
180
196
|
}
|
|
181
197
|
}
|
|
182
198
|
|