visaljs 0.0.6 → 0.0.8
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/README.md +63 -2
- package/THIRD_PARTY_LICENSES +1216 -0
- package/cli.js +4414 -325
- package/node/include/js_node.h +57 -1
- package/node/include/js_uv.h +8 -1
- package/node/prelude/_stream_duplex.js +4 -0
- package/node/prelude/_stream_passthrough.js +4 -0
- package/node/prelude/_stream_readable.js +4 -0
- package/node/prelude/_stream_transform.js +4 -0
- package/node/prelude/_stream_writable.js +4 -0
- package/node/prelude/assert.js +1334 -0
- package/node/prelude/assert_strict.js +12 -0
- package/node/prelude/async_hooks.js +1 -1
- package/node/prelude/buffer.js +43 -3
- package/node/prelude/child_process.js +1098 -0
- package/node/prelude/cluster.js +52 -0
- package/node/prelude/console.js +328 -0
- package/node/prelude/constants.js +10 -0
- package/node/prelude/crypto.js +1 -1
- package/node/prelude/diagnostics_channel.js +1 -1
- package/node/prelude/dns.js +1 -1
- package/node/prelude/domain.js +115 -0
- package/node/prelude/events.js +144 -16
- package/node/prelude/fs.js +1138 -151
- package/node/prelude/fs_promises.js +117 -11
- package/node/prelude/http.js +104 -27
- package/node/prelude/http2.js +1 -1
- package/node/prelude/https.js +148 -0
- package/node/prelude/inspector.js +27 -0
- package/node/prelude/inspector_promises.js +4 -0
- package/node/prelude/internal/async_context.js +1 -1
- package/node/prelude/internal/buffer_transcode.js +44 -0
- package/node/prelude/internal/comparisons.js +916 -0
- package/node/prelude/internal/compression_streams.js +153 -0
- package/node/prelude/internal/crypto/asym.js +27 -14
- package/node/prelude/internal/crypto/cipher.js +16 -5
- package/node/prelude/internal/crypto/diffiehellman.js +3 -2
- package/node/prelude/internal/crypto/hash.js +2 -1
- package/node/prelude/internal/crypto/kdf.js +14 -9
- package/node/prelude/internal/crypto/keys.js +63 -50
- package/node/prelude/internal/crypto/random.js +2 -1
- package/node/prelude/internal/crypto/util.js +4 -4
- package/node/prelude/internal/dotenv.js +98 -0
- package/node/prelude/internal/errors.js +21 -5
- package/node/prelude/internal/events_extras.js +116 -0
- package/node/prelude/internal/events_on.js +100 -0
- package/node/prelude/internal/features.js +55 -0
- package/node/prelude/internal/fetch.js +364 -0
- package/node/prelude/internal/form_data.js +376 -0
- package/node/prelude/internal/fs_bigint_stats.js +41 -0
- package/node/prelude/internal/fs_blob.js +19 -0
- package/node/prelude/internal/fs_cp.js +709 -0
- package/node/prelude/internal/fs_dir.js +166 -0
- package/node/prelude/internal/fs_filehandle.js +287 -0
- package/node/prelude/internal/fs_glob.js +296 -0
- package/node/prelude/internal/fs_statfs.js +42 -0
- package/node/prelude/internal/fs_stats.js +89 -0
- package/node/prelude/internal/fs_streams.js +541 -0
- package/node/prelude/internal/fs_utils.js +286 -0
- package/node/prelude/internal/fs_watch.js +580 -0
- package/node/prelude/internal/http_agent.js +26 -0
- package/node/prelude/internal/mime.js +249 -0
- package/node/prelude/internal/net.js +1 -0
- package/node/prelude/internal/parse_args.js +288 -0
- package/node/prelude/internal/perf_histogram.js +435 -0
- package/node/prelude/internal/perf_observe.js +119 -0
- package/node/prelude/internal/performance_global.js +19 -0
- package/node/prelude/internal/process_events.js +49 -1
- package/node/prelude/internal/process_memory.js +14 -0
- package/node/prelude/internal/process_more.js +414 -0
- package/node/prelude/internal/process_signals.js +2 -1
- package/node/prelude/internal/process_stdin.js +52 -0
- package/node/prelude/internal/process_stdio.js +36 -0
- package/node/prelude/internal/querystring.js +0 -0
- package/node/prelude/internal/readline.js +338 -0
- package/node/prelude/internal/socketaddress.js +8 -4
- package/node/prelude/internal/source_map.js +122 -0
- package/node/prelude/internal/stream_compose.js +74 -0
- package/node/prelude/internal/stream_from.js +6 -0
- package/node/prelude/internal/stream_operators.js +23 -0
- package/node/prelude/internal/stream_pipeline.js +7 -0
- package/node/prelude/internal/stream_transform.js +10 -0
- package/node/prelude/internal/stream_web_adapters.js +143 -0
- package/node/prelude/internal/streams/add_abort_signal.js +58 -0
- package/node/prelude/internal/streams/compose.js +244 -0
- package/node/prelude/internal/streams/destroy.js +358 -0
- package/node/prelude/internal/streams/duplex.js +199 -0
- package/node/prelude/internal/streams/duplexify.js +378 -0
- package/node/prelude/internal/streams/end_of_stream.js +387 -0
- package/node/prelude/internal/streams/errors.js +216 -0
- package/node/prelude/internal/streams/from.js +211 -0
- package/node/prelude/internal/streams/legacy.js +120 -0
- package/node/prelude/internal/streams/operators.js +375 -0
- package/node/prelude/internal/streams/passthrough.js +45 -0
- package/node/prelude/internal/streams/pipeline.js +468 -0
- package/node/prelude/internal/streams/readable.js +1835 -0
- package/node/prelude/internal/streams/state.js +48 -0
- package/node/prelude/internal/streams/transform.js +203 -0
- package/node/prelude/internal/streams/utils.js +355 -0
- package/node/prelude/internal/streams/validators.js +108 -0
- package/node/prelude/internal/streams/writable.js +1160 -0
- package/node/prelude/internal/structured_clone.js +238 -0
- package/node/prelude/internal/system_errors.js +37 -0
- package/node/prelude/internal/test_runner/mock.js +431 -0
- package/node/prelude/internal/test_runner/reporters.js +404 -0
- package/node/prelude/internal/test_runner/test.js +1571 -0
- package/node/prelude/internal/timers.js +38 -7
- package/node/prelude/internal/timers_global.js +1 -1
- package/node/prelude/internal/tls/common.js +8 -2
- package/node/prelude/internal/tls/wrap.js +3 -15
- package/node/prelude/internal/tls/x509.js +1 -1
- package/node/prelude/internal/tty_read_stream.js +39 -0
- package/node/prelude/internal/tty_streams.js +3 -0
- package/node/prelude/internal/util_debuglog.js +68 -0
- package/node/prelude/internal/util_diff.js +63 -0
- package/node/prelude/internal/util_more.js +111 -0
- package/node/prelude/internal/util_styles.js +76 -0
- package/node/prelude/internal/zlib_engines.js +1 -1
- package/node/prelude/module.js +194 -7
- package/node/prelude/net.js +2 -1
- package/node/prelude/os.js +88 -11
- package/node/prelude/path.js +11 -7
- package/node/prelude/path_posix.js +1 -1
- package/node/prelude/path_win32.js +1 -1
- package/node/prelude/perf_hooks.js +147 -0
- package/node/prelude/process.js +36 -1
- package/node/prelude/punycode.js +188 -0
- package/node/prelude/querystring.js +1 -1
- package/node/prelude/readline.js +8 -0
- package/node/prelude/readline_promises.js +88 -0
- package/node/prelude/repl.js +38 -0
- package/node/prelude/sea.js +23 -0
- package/node/prelude/stream.js +70 -1332
- package/node/prelude/stream_consumers.js +34 -0
- package/node/prelude/stream_promises.js +1 -1
- package/node/prelude/stream_web.js +15 -2
- package/node/prelude/string_decoder.js +1 -1
- package/node/prelude/sys.js +7 -0
- package/node/prelude/test.js +56 -0
- package/node/prelude/test_reporters.js +269 -0
- package/node/prelude/timers.js +7 -84
- package/node/prelude/timers_promises.js +1 -1
- package/node/prelude/tls.js +2 -1
- package/node/prelude/trace_events.js +52 -0
- package/node/prelude/tty.js +10 -4
- package/node/prelude/url.js +88 -27
- package/node/prelude/util.js +121 -5
- package/node/prelude/util_types.js +4 -3
- package/node/prelude/v8.js +814 -0
- package/node/prelude/vm.js +86 -0
- package/node/prelude/wasi.js +10 -0
- package/node/prelude/worker_threads.js +56 -0
- package/node/prelude/zlib.js +58 -25
- package/node/src/host_brotli.c +59 -11
- package/node/src/host_fs.c +342 -11
- package/node/src/host_fswatch.c +170 -0
- package/node/src/host_http.c +143 -20
- package/node/src/host_loop.c +25 -2
- package/node/src/host_net.c +55 -7
- package/node/src/host_os.c +55 -1
- package/node/src/host_proc.c +291 -0
- package/node/src/host_process.c +488 -0
- package/node/src/host_sys.c +64 -2
- package/node/src/host_zlib.c +27 -7
- package/node/src/host_zstd.c +41 -6
- package/node/third_party/hdrhistogram/LICENSE +42 -0
- package/node/third_party/hdrhistogram/README.md +5 -0
- package/node/third_party/libuv/LICENSE +0 -0
- package/node/third_party/libuv/LICENSE-extra +36 -0
- package/node/third_party/libuv/include/uv/aix.h +0 -0
- package/node/third_party/libuv/include/uv/bsd.h +0 -0
- package/node/third_party/libuv/include/uv/darwin.h +0 -0
- package/node/third_party/libuv/include/uv/errno.h +0 -0
- package/node/third_party/libuv/include/uv/linux.h +0 -0
- package/node/third_party/libuv/include/uv/os390.h +0 -0
- package/node/third_party/libuv/include/uv/posix.h +0 -0
- package/node/third_party/libuv/include/uv/sunos.h +0 -0
- package/node/third_party/libuv/include/uv/threadpool.h +0 -0
- package/node/third_party/libuv/include/uv/tree.h +0 -0
- package/node/third_party/libuv/include/uv/unix.h +0 -0
- package/node/third_party/libuv/include/uv/version.h +0 -0
- package/node/third_party/libuv/include/uv/win.h +0 -0
- package/node/third_party/libuv/include/uv.h +0 -0
- package/node/third_party/libuv/src/fs-poll.c +0 -0
- package/node/third_party/libuv/src/heap-inl.h +0 -0
- package/node/third_party/libuv/src/idna.c +0 -0
- package/node/third_party/libuv/src/idna.h +0 -0
- package/node/third_party/libuv/src/inet.c +0 -0
- package/node/third_party/libuv/src/queue.h +0 -0
- package/node/third_party/libuv/src/random.c +0 -0
- package/node/third_party/libuv/src/strscpy.c +0 -0
- package/node/third_party/libuv/src/strscpy.h +0 -0
- package/node/third_party/libuv/src/strtok.c +0 -0
- package/node/third_party/libuv/src/strtok.h +0 -0
- package/node/third_party/libuv/src/thread-common.c +0 -0
- package/node/third_party/libuv/src/threadpool.c +0 -0
- package/node/third_party/libuv/src/timer.c +0 -0
- package/node/third_party/libuv/src/unix/async.c +0 -0
- package/node/third_party/libuv/src/unix/bsd-ifaddrs.c +0 -0
- package/node/third_party/libuv/src/unix/core.c +0 -0
- package/node/third_party/libuv/src/unix/darwin-proctitle.c +0 -0
- package/node/third_party/libuv/src/unix/darwin-stub.h +0 -0
- package/node/third_party/libuv/src/unix/darwin-syscalls.h +0 -0
- package/node/third_party/libuv/src/unix/darwin.c +0 -0
- package/node/third_party/libuv/src/unix/dl.c +0 -0
- package/node/third_party/libuv/src/unix/fs.c +0 -0
- package/node/third_party/libuv/src/unix/fsevents.c +0 -0
- package/node/third_party/libuv/src/unix/getaddrinfo.c +0 -0
- package/node/third_party/libuv/src/unix/getnameinfo.c +0 -0
- package/node/third_party/libuv/src/unix/internal.h +0 -0
- package/node/third_party/libuv/src/unix/kqueue.c +0 -0
- package/node/third_party/libuv/src/unix/linux.c +0 -0
- package/node/third_party/libuv/src/unix/loop-watcher.c +0 -0
- package/node/third_party/libuv/src/unix/loop.c +0 -0
- package/node/third_party/libuv/src/unix/pipe.c +0 -0
- package/node/third_party/libuv/src/unix/poll.c +0 -0
- package/node/third_party/libuv/src/unix/process.c +0 -0
- package/node/third_party/libuv/src/unix/procfs-exepath.c +0 -0
- package/node/third_party/libuv/src/unix/proctitle.c +0 -0
- package/node/third_party/libuv/src/unix/random-devurandom.c +0 -0
- package/node/third_party/libuv/src/unix/random-getentropy.c +0 -0
- package/node/third_party/libuv/src/unix/random-getrandom.c +0 -0
- package/node/third_party/libuv/src/unix/random-sysctl-linux.c +0 -0
- package/node/third_party/libuv/src/unix/signal.c +0 -0
- package/node/third_party/libuv/src/unix/stream.c +0 -0
- package/node/third_party/libuv/src/unix/tcp.c +0 -0
- package/node/third_party/libuv/src/unix/thread.c +0 -0
- package/node/third_party/libuv/src/unix/tty.c +0 -0
- package/node/third_party/libuv/src/unix/udp.c +0 -0
- package/node/third_party/libuv/src/uv-common.c +0 -0
- package/node/third_party/libuv/src/uv-common.h +0 -0
- package/node/third_party/libuv/src/uv-data-getter-setters.c +0 -0
- package/node/third_party/libuv/src/version.c +0 -0
- package/node/third_party/llhttp/LICENSE +0 -0
- package/node/third_party/llhttp/api.c +0 -0
- package/node/third_party/llhttp/http.c +0 -0
- package/node/third_party/llhttp/llhttp.c +0 -0
- package/node/third_party/llhttp/llhttp.h +0 -0
- package/node/third_party/nodejs/LICENSE +47 -0
- package/node/third_party/nodejs/README.md +5 -0
- package/node/third_party/parseargs/LICENSE +21 -0
- package/node/third_party/parseargs/README.md +5 -0
- package/node/third_party/punycode/LICENSE +20 -0
- package/node/third_party/punycode/README.md +5 -0
- package/node/third_party/zlib/LICENSE.chromium +27 -0
- package/package.json +1 -5
- package/prebuilt/darwin-arm64/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/darwin-arm64/brotli-7995bbdacc52e51c.a +0 -0
- package/prebuilt/darwin-arm64/uv-72ab666eae197cd8.a +0 -0
- package/prebuilt/darwin-arm64/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/darwin-arm64/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/darwin-x64/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/darwin-x64/brotli-7995bbdacc52e51c.a +0 -0
- package/prebuilt/darwin-x64/uv-72ab666eae197cd8.a +0 -0
- package/prebuilt/darwin-x64/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/darwin-x64/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/linux-arm64/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/linux-arm64/brotli-65481ff838ce9def.a +0 -0
- package/prebuilt/linux-arm64/uv-f1353f50ff983f3c.a +0 -0
- package/prebuilt/linux-arm64/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/linux-arm64/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/linux-arm64-musl/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/linux-arm64-musl/brotli-65481ff838ce9def.a +0 -0
- package/prebuilt/linux-arm64-musl/uv-f1353f50ff983f3c.a +0 -0
- package/prebuilt/linux-arm64-musl/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/linux-arm64-musl/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/linux-x64/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/linux-x64/brotli-65481ff838ce9def.a +0 -0
- package/prebuilt/linux-x64/uv-f1353f50ff983f3c.a +0 -0
- package/prebuilt/linux-x64/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/linux-x64/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/linux-x64-musl/boringssl-4a47438eaf7e73ba.a +0 -0
- package/prebuilt/linux-x64-musl/brotli-65481ff838ce9def.a +0 -0
- package/prebuilt/linux-x64-musl/uv-f1353f50ff983f3c.a +0 -0
- package/prebuilt/linux-x64-musl/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/linux-x64-musl/zstd-015315ac7c784c73.a +0 -0
- package/prebuilt/win32-x64/boringssl-ce573858472b7fc9.a +0 -0
- package/prebuilt/win32-x64/brotli-20d86a61f30baeb3.a +0 -0
- package/prebuilt/win32-x64/uv-b11bae65d7fced82.a +0 -0
- package/prebuilt/win32-x64/zlib-4ce2317a4c3f5fb5.a +0 -0
- package/prebuilt/win32-x64/zstd-015315ac7c784c73.a +0 -0
- package/runtime/include/js_atoms.gen.h +0 -0
- package/runtime/include/js_atoms.h +1 -1
- package/runtime/include/js_bigint.h +1 -1
- package/runtime/include/js_buffer.h +4 -4
- package/runtime/include/js_builtins.h +41 -3
- package/runtime/include/js_console.h +9 -4
- package/runtime/include/js_convert.h +1 -1
- package/runtime/include/js_core.def +5 -4
- package/runtime/include/js_crypto.h +1 -1
- package/runtime/include/js_error.h +1 -1
- package/runtime/include/js_exception.h +21 -1
- package/runtime/include/js_function.h +33 -9
- package/runtime/include/js_gc.h +172 -30
- package/runtime/include/js_generator.h +2 -2
- package/runtime/include/js_host.h +19 -1
- package/runtime/include/js_jobs.h +5 -5
- package/runtime/include/js_module.h +1 -1
- package/runtime/include/js_object.h +142 -15
- package/runtime/include/js_ops.h +107 -5
- package/runtime/include/js_promise.h +3 -3
- package/runtime/include/js_regexp.h +1 -1
- package/runtime/include/js_runtime.h +0 -0
- package/runtime/include/js_symbol.h +1 -1
- package/runtime/include/js_web.h +2 -1
- package/runtime/include/jscell.h +22 -15
- package/runtime/include/jscontext.h +74 -39
- package/runtime/include/jsnum.h +1 -1
- package/runtime/include/jsstring.h +19 -6
- package/runtime/include/jsvalue.h +7 -3
- package/runtime/src/arguments.c +2 -2
- package/runtime/src/array.c +4 -1
- package/runtime/src/arraybuffer.c +19 -7
- package/runtime/src/async_iter.c +4 -3
- package/runtime/src/atoms.c +1 -1
- package/runtime/src/base64.c +2 -2
- package/runtime/src/bigint.c +1 -1
- package/runtime/src/blob.c +22 -9
- package/runtime/src/boringssl_support.cc +1 -1
- package/runtime/src/buffer.c +299 -91
- package/runtime/src/builtin_table.c +1 -1
- package/runtime/src/builtins.c +30 -4
- package/runtime/src/builtins_util.h +0 -0
- package/runtime/src/collections.c +18 -3
- package/runtime/src/components.c +1 -1
- package/runtime/src/console.c +14 -7
- package/runtime/src/convert.c +0 -0
- package/runtime/src/core_all.c +1 -1
- package/runtime/src/crypto.c +1 -1
- package/runtime/src/crypto_asym.c +1 -1
- package/runtime/src/crypto_bn.c +1 -1
- package/runtime/src/crypto_cipher.c +10 -3
- package/runtime/src/crypto_hash.c +1 -1
- package/runtime/src/crypto_host.c +1 -1
- package/runtime/src/crypto_internal.h +1 -1
- package/runtime/src/crypto_kdf.c +1 -1
- package/runtime/src/crypto_key.c +14 -1
- package/runtime/src/crypto_pkey.c +1 -1
- package/runtime/src/crypto_subtle.c +142 -58
- package/runtime/src/crypto_tls.c +1 -1
- package/runtime/src/date.c +5 -2
- package/runtime/src/domexception.c +2 -2
- package/runtime/src/elements.c +56 -17
- package/runtime/src/elements.h +7 -2
- package/runtime/src/encoding.c +1 -1
- package/runtime/src/error.c +4 -4
- package/runtime/src/events.c +23 -14
- package/runtime/src/exception.c +1 -1
- package/runtime/src/fetch.c +241 -17
- package/runtime/src/function.c +31 -19
- package/runtime/src/gc.c +1716 -207
- package/runtime/src/gc_visit.h +87 -0
- package/runtime/src/generator.c +5 -3
- package/runtime/src/global.c +14 -6
- package/runtime/src/headers.c +10 -10
- package/runtime/src/inspect.c +76 -17
- package/runtime/src/internal.h +5 -2
- package/runtime/src/iterate.c +94 -2
- package/runtime/src/iterator.c +1 -1
- package/runtime/src/jobs.c +11 -5
- package/runtime/src/jsnum.c +2 -2
- package/runtime/src/json.c +1 -1
- package/runtime/src/math.c +9 -1
- package/runtime/src/module.c +3 -3
- package/runtime/src/number.c +0 -0
- package/runtime/src/object.c +107 -74
- package/runtime/src/ops.c +21 -3
- package/runtime/src/os.c +192 -1
- package/runtime/src/os.h +33 -2
- package/runtime/src/process.c +73 -8
- package/runtime/src/promise.c +4 -4
- package/runtime/src/proxy.c +1 -1
- package/runtime/src/reflect.c +1 -1
- package/runtime/src/regexp.c +134 -2
- package/runtime/src/regexp_anchor.h +1 -1
- package/runtime/src/regexp_message.h +1 -1
- package/runtime/src/shape.c +10 -19
- package/runtime/src/shape.h +0 -0
- package/runtime/src/streams.c +22 -8
- package/runtime/src/streams.h +0 -0
- package/runtime/src/string.c +64 -25
- package/runtime/src/string_builtins.c +7 -7
- package/runtime/src/symbol.c +2 -7
- package/runtime/src/test_host.c +3 -3
- package/runtime/src/tls_roots.gen.h +102 -620
- package/runtime/src/typedarray.c +8 -3
- package/runtime/src/tznames.gen.h +2 -1
- package/runtime/src/uri.c +1 -1
- package/runtime/src/url.c +42 -39
- package/runtime/src/weak.c +15 -12
- package/runtime/src/web.c +21 -3
- package/runtime/src/wrapper.c +0 -0
- package/runtime/src/writable.c +7 -6
- package/runtime/third_party/ada-idna/LICENSE-MIT +0 -0
- package/runtime/third_party/ada-idna/README.md +7 -7
- package/runtime/third_party/ada-idna/convert.mjs +89 -27
- package/runtime/third_party/ada-idna/idna.c +30 -31
- package/runtime/third_party/ada-idna/idna.h +0 -0
- package/runtime/third_party/ada-idna/idna_tables.h +2272 -1952
- package/runtime/third_party/boringssl/third_party/fiat/LICENSE +15 -0
- package/runtime/third_party/mozilla-ca/LICENSE +373 -0
- package/runtime/third_party/mozilla-ca/README.md +9 -0
- package/runtime/third_party/nodejs/LICENSE +47 -0
- package/runtime/third_party/nodejs/README.md +7 -0
- package/runtime/third_party/quickjs-dtoa/LICENSE +0 -0
- package/runtime/third_party/quickjs-dtoa/README.md +1 -1
- package/runtime/third_party/quickjs-dtoa/dtoa.c +0 -0
- package/runtime/third_party/quickjs-dtoa/dtoa.h +0 -0
- package/runtime/third_party/quickjs-dtoa/dtoa_compat.h +0 -0
- package/runtime/third_party/quickjs-regexp/LICENSE +0 -0
- package/runtime/third_party/quickjs-regexp/README.md +2 -2
- package/runtime/third_party/quickjs-regexp/cutils.c +0 -0
- package/runtime/third_party/quickjs-regexp/cutils.h +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp-opcode.h +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp.c +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp.h +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode-table.h +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode.c +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode.h +0 -0
- package/runtime/third_party/unicode/LICENSE +39 -0
- package/runtime/third_party/unicode/README.md +9 -0
- package/runtime/third_party/v8-ieee754/LICENSE +0 -0
- package/runtime/third_party/v8-ieee754/LICENSE.fdlibm +10 -0
- package/runtime/third_party/v8-ieee754/README.md +3 -2
- package/runtime/third_party/v8-ieee754/convert.py +0 -0
- package/runtime/third_party/v8-ieee754/ieee754.c +0 -0
- package/runtime/third_party/v8-ieee754/ieee754.h +0 -0
- package/runtime/tools/regexp_compile.c +2 -2
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// structuredClone, as Node's (V8's ValueSerializer and Node's host objects): ordinary objects and
|
|
2
|
+
// arrays (own enumerable properties, cycles and shared references kept), Date, RegExp, Map, Set,
|
|
3
|
+
// the primitive wrappers, ArrayBuffers and their views (a Buffer comes back a Uint8Array), the
|
|
4
|
+
// errors, Blob and File, DOMException; ArrayBuffers and web streams moved by the transfer list.
|
|
5
|
+
// Anything else is V8's DataCloneError. A program that names structuredClone gets this module
|
|
6
|
+
// first (implicitModules in node/index.ts).
|
|
7
|
+
import { cloneClass } from "visaljs:host";
|
|
8
|
+
import { codeError } from "./errors.js";
|
|
9
|
+
|
|
10
|
+
/* the intrinsics the clone reads through, as they are when the program starts */
|
|
11
|
+
const TypedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);
|
|
12
|
+
const getter = (proto, key) => Object.getOwnPropertyDescriptor(proto, key).get;
|
|
13
|
+
const typedArrayTag = getter(TypedArrayPrototype, Symbol.toStringTag);
|
|
14
|
+
const typedArrayBuffer = getter(TypedArrayPrototype, "buffer");
|
|
15
|
+
const typedArrayOffset = getter(TypedArrayPrototype, "byteOffset");
|
|
16
|
+
const typedArrayLength = getter(TypedArrayPrototype, "length");
|
|
17
|
+
const dataViewBuffer = getter(DataView.prototype, "buffer");
|
|
18
|
+
const dataViewOffset = getter(DataView.prototype, "byteOffset");
|
|
19
|
+
const dataViewLength = getter(DataView.prototype, "byteLength");
|
|
20
|
+
const arrayBufferLength = getter(ArrayBuffer.prototype, "byteLength");
|
|
21
|
+
const arrayBufferDetached = getter(ArrayBuffer.prototype, "detached");
|
|
22
|
+
const arrayBufferResizable = getter(ArrayBuffer.prototype, "resizable");
|
|
23
|
+
const arrayBufferMaxLength = getter(ArrayBuffer.prototype, "maxByteLength");
|
|
24
|
+
const arrayBufferSlice = ArrayBuffer.prototype.slice;
|
|
25
|
+
const arrayBufferTransfer = ArrayBuffer.prototype.transfer;
|
|
26
|
+
const regExpSource = getter(RegExp.prototype, "source");
|
|
27
|
+
const regExpFlags = getter(RegExp.prototype, "flags");
|
|
28
|
+
const dateTime = Date.prototype.getTime;
|
|
29
|
+
const mapForEach = Map.prototype.forEach;
|
|
30
|
+
const setForEach = Set.prototype.forEach;
|
|
31
|
+
const fileName = getter(File.prototype, "name");
|
|
32
|
+
const ERRORS = { Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError };
|
|
33
|
+
const STREAMS = new Set(["ReadableStream", "WritableStream", "TransformStream"]);
|
|
34
|
+
/* objects V8 can't serialize: "#<Name> could not be cloned." */
|
|
35
|
+
const UNCLONEABLE = new Set(["Proxy", "Arguments", "Promise", "WeakMap", "WeakSet", "WeakRef", "FinalizationRegistry", "Generator",
|
|
36
|
+
"AsyncGenerator", "Iterator", "Array Iterator", "Map Iterator", "Set Iterator", "String Iterator", "RegExp String Iterator",
|
|
37
|
+
"AsyncFromSyncIterator", "Symbol"]);
|
|
38
|
+
|
|
39
|
+
const dataCloneError = (message) => new DOMException(message, "DataCloneError");
|
|
40
|
+
|
|
41
|
+
function isFile(blob) {
|
|
42
|
+
try {
|
|
43
|
+
fileName.call(blob);
|
|
44
|
+
return true;
|
|
45
|
+
} catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** A copy of an ArrayBuffer, resizable as it is. */
|
|
51
|
+
function copyArrayBuffer(buffer) {
|
|
52
|
+
if (arrayBufferDetached.call(buffer)) throw dataCloneError("An ArrayBuffer is detached and could not be cloned.");
|
|
53
|
+
if (!arrayBufferResizable.call(buffer)) return arrayBufferSlice.call(buffer, 0);
|
|
54
|
+
const length = arrayBufferLength.call(buffer);
|
|
55
|
+
const copy = new ArrayBuffer(length, { maxByteLength: arrayBufferMaxLength.call(buffer) });
|
|
56
|
+
new Uint8Array(copy).set(new Uint8Array(buffer, 0, length));
|
|
57
|
+
return copy;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A stream moved by the transfer list: a new one of its kind that reads (or writes) through the
|
|
61
|
+
* original, which is then locked. */
|
|
62
|
+
function transferStream(stream, kind) {
|
|
63
|
+
if (kind === "ReadableStream") {
|
|
64
|
+
const reader = stream.getReader();
|
|
65
|
+
return new ReadableStream({
|
|
66
|
+
pull: (controller) => reader.read().then(({ value, done }) => (done ? controller.close() : controller.enqueue(value))),
|
|
67
|
+
cancel: (reason) => reader.cancel(reason),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (kind === "WritableStream") {
|
|
71
|
+
const writer = stream.getWriter();
|
|
72
|
+
return new WritableStream({
|
|
73
|
+
write: (chunk) => writer.write(chunk),
|
|
74
|
+
close: () => writer.close(),
|
|
75
|
+
abort: (reason) => writer.abort(reason),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const readable = transferStream(stream.readable, "ReadableStream");
|
|
79
|
+
const writable = transferStream(stream.writable, "WritableStream");
|
|
80
|
+
const reader = readable.getReader();
|
|
81
|
+
const writer = writable.getWriter();
|
|
82
|
+
return new TransformStream({
|
|
83
|
+
start(controller) {
|
|
84
|
+
const pump = () => reader.read().then(({ value, done }) => {
|
|
85
|
+
if (done) return controller.terminate();
|
|
86
|
+
controller.enqueue(value);
|
|
87
|
+
return pump();
|
|
88
|
+
}, (error) => controller.error(error));
|
|
89
|
+
pump();
|
|
90
|
+
},
|
|
91
|
+
transform: (chunk) => writer.write(chunk),
|
|
92
|
+
flush: () => writer.close(),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function defineHidden(object, key, value) {
|
|
97
|
+
Object.defineProperty(object, key, { value, writable: true, enumerable: false, configurable: true });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function cloneValue(value, memory, transferred) {
|
|
101
|
+
if (typeof value === "symbol") throw dataCloneError(`${String(value)} could not be cloned.`);
|
|
102
|
+
if ((typeof value !== "object" && typeof value !== "function") || value === null) return value;
|
|
103
|
+
const known = memory.get(value);
|
|
104
|
+
if (known !== undefined) return known;
|
|
105
|
+
const kind = cloneClass(value);
|
|
106
|
+
const remember = (copy) => {
|
|
107
|
+
memory.set(value, copy);
|
|
108
|
+
return copy;
|
|
109
|
+
};
|
|
110
|
+
switch (kind) {
|
|
111
|
+
case "Function":
|
|
112
|
+
throw dataCloneError(`${Function.prototype.toString.call(value)} could not be cloned.`);
|
|
113
|
+
case "Object": {
|
|
114
|
+
const copy = remember({});
|
|
115
|
+
for (const key of Object.keys(value)) copy[key] = cloneValue(value[key], memory, transferred);
|
|
116
|
+
return copy;
|
|
117
|
+
}
|
|
118
|
+
case "Array": {
|
|
119
|
+
const copy = remember(new Array(value.length));
|
|
120
|
+
for (const key of Object.keys(value)) copy[key] = cloneValue(value[key], memory, transferred);
|
|
121
|
+
return copy;
|
|
122
|
+
}
|
|
123
|
+
case "Date":
|
|
124
|
+
return remember(new Date(dateTime.call(value)));
|
|
125
|
+
case "RegExp":
|
|
126
|
+
return remember(new RegExp(regExpSource.call(value), regExpFlags.call(value)));
|
|
127
|
+
case "Number":
|
|
128
|
+
return remember(Object(Number.prototype.valueOf.call(value)));
|
|
129
|
+
case "String":
|
|
130
|
+
return remember(Object(String.prototype.valueOf.call(value)));
|
|
131
|
+
case "Boolean":
|
|
132
|
+
return remember(Object(Boolean.prototype.valueOf.call(value)));
|
|
133
|
+
case "BigInt":
|
|
134
|
+
return remember(Object(BigInt.prototype.valueOf.call(value)));
|
|
135
|
+
case "Map": {
|
|
136
|
+
const copy = remember(new Map());
|
|
137
|
+
const entries = [];
|
|
138
|
+
mapForEach.call(value, (v, k) => entries.push(k, v));
|
|
139
|
+
for (let i = 0; i < entries.length; i += 2) copy.set(cloneValue(entries[i], memory, transferred), cloneValue(entries[i + 1], memory, transferred));
|
|
140
|
+
return copy;
|
|
141
|
+
}
|
|
142
|
+
case "Set": {
|
|
143
|
+
const copy = remember(new Set());
|
|
144
|
+
const items = [];
|
|
145
|
+
setForEach.call(value, (v) => items.push(v));
|
|
146
|
+
for (const item of items) copy.add(cloneValue(item, memory, transferred));
|
|
147
|
+
return copy;
|
|
148
|
+
}
|
|
149
|
+
case "ArrayBuffer":
|
|
150
|
+
return remember(copyArrayBuffer(value));
|
|
151
|
+
case "TypedArray": {
|
|
152
|
+
const tag = typedArrayTag.call(value);
|
|
153
|
+
const offset = typedArrayOffset.call(value), length = typedArrayLength.call(value);
|
|
154
|
+
const buffer = cloneValue(typedArrayBuffer.call(value), memory, transferred);
|
|
155
|
+
return remember(new globalThis[tag](buffer, offset, length));
|
|
156
|
+
}
|
|
157
|
+
case "DataView": {
|
|
158
|
+
const offset = dataViewOffset.call(value), length = dataViewLength.call(value);
|
|
159
|
+
const buffer = cloneValue(dataViewBuffer.call(value), memory, transferred);
|
|
160
|
+
return remember(new DataView(buffer, offset, length));
|
|
161
|
+
}
|
|
162
|
+
case "Error": {
|
|
163
|
+
/* V8's WriteJSError: the name (one of the native errors', else Error), an own message, the
|
|
164
|
+
* stack, and an own cause */
|
|
165
|
+
const name = value.name;
|
|
166
|
+
const Ctor = Object.hasOwn(ERRORS, name) ? ERRORS[name] : Error;
|
|
167
|
+
const copy = remember(new Ctor());
|
|
168
|
+
const message = Object.getOwnPropertyDescriptor(value, "message");
|
|
169
|
+
if (message && "value" in message) defineHidden(copy, "message", String(message.value));
|
|
170
|
+
const stack = value.stack;
|
|
171
|
+
if (typeof stack === "string") defineHidden(copy, "stack", stack);
|
|
172
|
+
else delete copy.stack;
|
|
173
|
+
if (Object.hasOwn(value, "cause")) defineHidden(copy, "cause", cloneValue(value.cause, memory, transferred));
|
|
174
|
+
return copy;
|
|
175
|
+
}
|
|
176
|
+
case "Blob":
|
|
177
|
+
return remember(isFile(value) ? new File([value], value.name, { type: value.type, lastModified: value.lastModified })
|
|
178
|
+
: new Blob([value], { type: value.type }));
|
|
179
|
+
case "DOMException": {
|
|
180
|
+
const copy = remember(new DOMException(value.message, value.name));
|
|
181
|
+
defineHidden(copy, "stack", value.stack);
|
|
182
|
+
return copy;
|
|
183
|
+
}
|
|
184
|
+
default:
|
|
185
|
+
if (STREAMS.has(kind)) {
|
|
186
|
+
const moved = transferred.get(value);
|
|
187
|
+
if (moved === undefined) throw dataCloneError("Object that needs transfer was found in message but not listed in transferList");
|
|
188
|
+
return remember(moved);
|
|
189
|
+
}
|
|
190
|
+
if (UNCLONEABLE.has(kind)) {
|
|
191
|
+
const name = kind === "Proxy" || kind === "Arguments" ? "Object" : kind;
|
|
192
|
+
throw dataCloneError(`#<${name}> could not be cloned.`);
|
|
193
|
+
}
|
|
194
|
+
throw dataCloneError("Cannot clone object of unsupported type.");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function structuredClone(value, options = undefined) {
|
|
199
|
+
if (arguments.length === 0) {
|
|
200
|
+
/* Node's own wording, argument name and all */
|
|
201
|
+
throw codeError(TypeError, "ERR_MISSING_ARGS", 'The "The value argument must be specified" argument must be specified');
|
|
202
|
+
}
|
|
203
|
+
const transfer = [];
|
|
204
|
+
if (options !== undefined && options !== null) {
|
|
205
|
+
if (typeof options !== "object" && typeof options !== "function") {
|
|
206
|
+
throw codeError(TypeError, "ERR_INVALID_ARG_TYPE", "Failed to execute 'structuredClone': Options cannot be converted to a dictionary");
|
|
207
|
+
}
|
|
208
|
+
const list = options.transfer;
|
|
209
|
+
if (list !== undefined) {
|
|
210
|
+
if ((typeof list !== "object" && typeof list !== "function") || list === null || typeof list[Symbol.iterator] !== "function") {
|
|
211
|
+
throw codeError(TypeError, "ERR_INVALID_ARG_TYPE", "Failed to execute 'structuredClone': transfer in Options cannot be converted to sequence.");
|
|
212
|
+
}
|
|
213
|
+
transfer.push(...list);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/* the transfer list: ArrayBuffers (once each) and streams */
|
|
217
|
+
const buffers = [];
|
|
218
|
+
const transferred = new Map();
|
|
219
|
+
for (const item of transfer) {
|
|
220
|
+
const kind = cloneClass(item);
|
|
221
|
+
if (kind === "ArrayBuffer") {
|
|
222
|
+
if (buffers.includes(item)) throw dataCloneError("Transfer list contains duplicate ArrayBuffer");
|
|
223
|
+
buffers.push(item);
|
|
224
|
+
} else if (!STREAMS.has(kind)) {
|
|
225
|
+
throw dataCloneError("Found invalid value in transferList.");
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
for (const item of transfer) {
|
|
229
|
+
const kind = cloneClass(item);
|
|
230
|
+
if (STREAMS.has(kind) && !transferred.has(item)) transferred.set(item, transferStream(item, kind));
|
|
231
|
+
}
|
|
232
|
+
/* a transferred ArrayBuffer is copied like the others, and detached once the clone is made */
|
|
233
|
+
const result = cloneValue(value, new Map(), transferred);
|
|
234
|
+
for (const buffer of buffers) arrayBufferTransfer.call(buffer);
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
Object.defineProperty(globalThis, "structuredClone", { value: structuredClone, writable: true, enumerable: true, configurable: true });
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// util.getSystemErrorName, getSystemErrorMessage and getSystemErrorMap: libuv's errors, by code.
|
|
2
|
+
// Linked into programs that name them (internal/features.js).
|
|
3
|
+
import { errnoMap, errnoMessage, errnoName } from "visaljs:host";
|
|
4
|
+
import { codeError, invalidArgType } from "./errors.js";
|
|
5
|
+
import { features } from "./features.js";
|
|
6
|
+
|
|
7
|
+
function validateErrno(err) {
|
|
8
|
+
if (typeof err !== "number") throw invalidArgType("err", "of type number", err);
|
|
9
|
+
if (!Number.isInteger(err)) {
|
|
10
|
+
const e = codeError(RangeError, "ERR_OUT_OF_RANGE", `The value of "err" is out of range. It must be an integer. Received ${err}`);
|
|
11
|
+
throw e;
|
|
12
|
+
}
|
|
13
|
+
if (err >= 0) {
|
|
14
|
+
throw codeError(RangeError, "ERR_OUT_OF_RANGE", `The value of "err" is out of range. It must be a negative integer. Received ${err}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** "ENOENT" for -2. */
|
|
19
|
+
function getSystemErrorName(err) {
|
|
20
|
+
validateErrno(err);
|
|
21
|
+
const entry = errnoMap().find(([code]) => code === err);
|
|
22
|
+
return entry ? entry[1] : errnoName(err) === "UNKNOWN" ? `Unknown system error ${err}` : errnoName(err);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** "no such file or directory" for -2. */
|
|
26
|
+
function getSystemErrorMessage(err) {
|
|
27
|
+
validateErrno(err);
|
|
28
|
+
const entry = errnoMap().find(([code]) => code === err);
|
|
29
|
+
return entry ? entry[2] : errnoMessage(err) === "unknown error" ? `Unknown system error ${err}` : errnoMessage(err);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Every system error: code → [name, message]. */
|
|
33
|
+
function getSystemErrorMap() {
|
|
34
|
+
return new Map(errnoMap().map(([code, name, message]) => [code, [name, message]]));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Object.assign(features, { getSystemErrorName, getSystemErrorMessage, getSystemErrorMap });
|