visaljs 0.0.7 → 0.0.9
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 +68 -4
- package/THIRD_PARTY_LICENSES +1216 -0
- package/cli.js +4461 -321
- package/node/include/js_node.h +57 -1
- package/node/include/js_uv.h +8 -1
- package/node/prelude/_http_agent.js +5 -0
- package/node/prelude/_http_server.js +7 -0
- 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 +8 -2
- package/node/prelude/domain.js +115 -0
- package/node/prelude/events.js +148 -16
- package/node/prelude/fs.js +1138 -151
- package/node/prelude/fs_promises.js +117 -11
- package/node/prelude/http.js +784 -301
- package/node/prelude/http2.js +1 -1
- package/node/prelude/https.js +159 -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 +113 -0
- package/node/prelude/internal/events_on.js +100 -0
- package/node/prelude/internal/features.js +72 -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 +114 -2
- package/node/prelude/internal/http_symbols.js +3 -0
- package/node/prelude/internal/mime.js +249 -0
- package/node/prelude/internal/net.js +1 -0
- package/node/prelude/internal/net_bound.js +123 -0
- package/node/prelude/internal/net_onread.js +73 -0
- package/node/prelude/internal/net_tos.js +54 -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 +125 -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 +5 -16
- 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 +219 -8
- package/node/prelude/net.js +197 -49
- 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 +151 -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 +292 -39
- package/node/src/host_loop.c +25 -2
- package/node/src/host_net.c +130 -16
- 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 -1
- 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 +5 -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 +5 -1
- package/runtime/include/jscell.h +22 -15
- package/runtime/include/jscontext.h +82 -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 +38 -4
- 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 +42 -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 +1720 -211
- 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 +9 -6
- 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 +700 -11
- package/runtime/src/regexp_anchor.h +1 -1
- package/runtime/src/regexp_message.h +1 -1
- package/runtime/src/shape.c +78 -20
- 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 +110 -36
- 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,54 @@
|
|
|
1
|
+
// net.Socket's type of service, as Node's: setTypeOfService, getTypeOfService and the
|
|
2
|
+
// typeOfService option (IP_TOS, or IPV6_TCLASS on an IPv6 socket; on Windows, best effort). Linked
|
|
3
|
+
// into programs that name it (internal/features.js).
|
|
4
|
+
import { errnoName, netTypeOfService } from "visaljs:host";
|
|
5
|
+
import { invalidArgType } from "./errors.js";
|
|
6
|
+
import { features } from "./features.js";
|
|
7
|
+
import { validateInt32 } from "./streams/validators.js";
|
|
8
|
+
|
|
9
|
+
const isWindows = process.platform === "win32";
|
|
10
|
+
const UV_EBADF = -9;
|
|
11
|
+
|
|
12
|
+
/* Node's handle exists from connect() on, its descriptor only once connect(2) is under way:
|
|
13
|
+
* between the two, the option can't be set or read */
|
|
14
|
+
const noDescriptor = (socket) => socket._handle === null && socket.connecting;
|
|
15
|
+
|
|
16
|
+
features.validateTypeOfService = (tos) => validateInt32(tos, "options.typeOfService", 0, 255);
|
|
17
|
+
|
|
18
|
+
/* kept until there's a handle */
|
|
19
|
+
features.setTypeOfService = function (tos) {
|
|
20
|
+
if (Number.isNaN(tos)) throw invalidArgType("tos", "of type number", tos);
|
|
21
|
+
validateInt32(tos, "tos", 0, 255);
|
|
22
|
+
if (noDescriptor(this) && !this._isPipe && tos !== this._tos) {
|
|
23
|
+
this._tos = tos;
|
|
24
|
+
if (!isWindows) throw features.net.errnoException(UV_EBADF, "setTypeOfService");
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
if (this._handle === null || this._isPipe) {
|
|
28
|
+
this._tos = tos;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
if (tos !== this._tos) {
|
|
32
|
+
this._tos = tos;
|
|
33
|
+
const err = netTypeOfService(this._handle, tos);
|
|
34
|
+
if (err && !isWindows) throw features.net.errnoException(err, "setTypeOfService");
|
|
35
|
+
}
|
|
36
|
+
return this;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
features.getTypeOfService = function () {
|
|
40
|
+
if (noDescriptor(this) && !this._isPipe && !isWindows) throw features.net.errnoException(UV_EBADF, "getTypeOfService");
|
|
41
|
+
if (this._handle === null || this._isPipe) return this._tos !== undefined ? this._tos : 0;
|
|
42
|
+
const res = netTypeOfService(this._handle, -1);
|
|
43
|
+
if (res < 0) {
|
|
44
|
+
if (isWindows) return this._tos !== undefined ? this._tos : 0;
|
|
45
|
+
throw features.net.errnoException(res, "getTypeOfService");
|
|
46
|
+
}
|
|
47
|
+
return res;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/* the type of service given before the connection, set once it's made */
|
|
51
|
+
features.applyTypeOfService = (socket) => {
|
|
52
|
+
const err = netTypeOfService(socket._handle, socket._tos);
|
|
53
|
+
if (err && errnoName(err) !== "EBADF" && !isWindows) socket.emit("error", features.net.errnoException(err, "setTypeOfService"));
|
|
54
|
+
};
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// util.parseArgs: Node's internal/util/parse_args (from pkgjs/parseargs, MIT): command-line
|
|
2
|
+
// arguments against declared options (string or boolean, short aliases, multiple, defaults),
|
|
3
|
+
// strict about unknown options and positionals, with tokens on request. Linked into programs
|
|
4
|
+
// that name parseArgs (internal/features.js).
|
|
5
|
+
// Ported from Node.js and pkgjs/parseargs (MIT): node/third_party/nodejs/LICENSE and
|
|
6
|
+
// node/third_party/parseargs/LICENSE.
|
|
7
|
+
import { codeError, invalidArgType, invalidArgValue } from "./errors.js";
|
|
8
|
+
import { features } from "./features.js";
|
|
9
|
+
|
|
10
|
+
const isOptionValue = (value) => value != null; /* a value an option may take: anything not nullish */
|
|
11
|
+
|
|
12
|
+
/* `--foo=bar` and `-f` style */
|
|
13
|
+
const isLoneShortOption = (arg) => arg.length === 2 && arg[0] === "-" && arg[1] !== "-";
|
|
14
|
+
const isLoneLongOption = (arg) => arg.length > 2 && arg.startsWith("--") && !arg.includes("=", 3);
|
|
15
|
+
const isLongOptionAndValue = (arg) => arg.length > 2 && arg.startsWith("--") && arg.includes("=", 3);
|
|
16
|
+
const isShortOptionGroup = (arg, options) => {
|
|
17
|
+
if (arg.length <= 2 || arg[0] !== "-" || arg[1] === "-") return false;
|
|
18
|
+
const firstShort = arg[1];
|
|
19
|
+
const longOption = findLongOptionForShort(firstShort, options);
|
|
20
|
+
return options[longOption]?.type !== "string";
|
|
21
|
+
};
|
|
22
|
+
const isShortOptionAndValue = (arg, options) => {
|
|
23
|
+
if (arg.length <= 2 || arg[0] !== "-" || arg[1] === "-") return false;
|
|
24
|
+
const shortOption = arg[1];
|
|
25
|
+
const longOption = findLongOptionForShort(shortOption, options);
|
|
26
|
+
return options[longOption]?.type === "string";
|
|
27
|
+
};
|
|
28
|
+
/* the next argument may be an option's value: it isn't an option itself */
|
|
29
|
+
const isOptionLikeValue = (value) => value != null && value.length > 1 && value[0] === "-";
|
|
30
|
+
|
|
31
|
+
function findLongOptionForShort(shortOption, options) {
|
|
32
|
+
for (const [longOption, config] of Object.entries(options)) {
|
|
33
|
+
if (config.short === shortOption) return longOption;
|
|
34
|
+
}
|
|
35
|
+
return shortOption;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Whether a known option should be stored as an array. */
|
|
39
|
+
function useDefaultValueOption(longOption, optionConfig, values) {
|
|
40
|
+
return optionConfig.default !== undefined && values[longOption] === undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function validateString(value, name) {
|
|
44
|
+
if (typeof value !== "string") throw invalidArgType(name, "of type string", value);
|
|
45
|
+
}
|
|
46
|
+
function validateBoolean(value, name) {
|
|
47
|
+
if (typeof value !== "boolean") throw invalidArgType(name, "of type boolean", value);
|
|
48
|
+
}
|
|
49
|
+
function validateObject(value, name) {
|
|
50
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw invalidArgType(name, "of type object", value);
|
|
51
|
+
}
|
|
52
|
+
function validateArray(value, name) {
|
|
53
|
+
if (!Array.isArray(value)) throw invalidArgType(name, "an instance of Array", value);
|
|
54
|
+
}
|
|
55
|
+
function validateStringArray(value, name) {
|
|
56
|
+
validateArray(value, name);
|
|
57
|
+
for (let i = 0; i < value.length; i++) validateString(value[i], `${name}[${i}]`);
|
|
58
|
+
}
|
|
59
|
+
function validateBooleanArray(value, name) {
|
|
60
|
+
validateArray(value, name);
|
|
61
|
+
for (let i = 0; i < value.length; i++) validateBoolean(value[i], `${name}[${i}]`);
|
|
62
|
+
}
|
|
63
|
+
function validateUnion(value, name, union) {
|
|
64
|
+
if (!union.includes(value)) throw invalidArgType(name, `('${union.join("|")}')`, value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const parseArgsUnknownOption = (option, allowPositionals) => {
|
|
68
|
+
const suggestDashDash = allowPositionals ? `. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${JSON.stringify(option)}` : "";
|
|
69
|
+
return codeError(TypeError, "ERR_PARSE_ARGS_UNKNOWN_OPTION", `Unknown option '${option}'${suggestDashDash}`);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
function checkOptionLikeValue(token) {
|
|
73
|
+
if (!token.inlineValue && isOptionLikeValue(token.value)) {
|
|
74
|
+
const example = token.rawName.startsWith("--") ? `'${token.rawName}=-XYZ'` : `'--${token.name}=-XYZ' or '${token.rawName}-XYZ'`;
|
|
75
|
+
const errorMessage = `Option '${token.rawName}' argument is ambiguous.
|
|
76
|
+
Did you forget to specify the option argument for '${token.rawName}'?
|
|
77
|
+
To specify an option argument starting with a dash use ${example}.`;
|
|
78
|
+
throw codeError(TypeError, "ERR_PARSE_ARGS_INVALID_OPTION_VALUE", errorMessage);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function checkOptionUsage(config, token) {
|
|
83
|
+
if (!Object.hasOwn(config.options, token.name)) throw parseArgsUnknownOption(token.rawName, config.allowPositionals);
|
|
84
|
+
const short = config.options[token.name].short;
|
|
85
|
+
const shortAndLong = `${short ? `-${short}, ` : ""}--${token.name}`;
|
|
86
|
+
const type = config.options[token.name].type;
|
|
87
|
+
if (type === "string" && typeof token.value !== "string") {
|
|
88
|
+
throw codeError(TypeError, "ERR_PARSE_ARGS_INVALID_OPTION_VALUE", `Option '${shortAndLong} <value>' argument missing`);
|
|
89
|
+
}
|
|
90
|
+
if (type === "boolean" && token.value != null) {
|
|
91
|
+
throw codeError(TypeError, "ERR_PARSE_ARGS_INVALID_OPTION_VALUE", `Option '${shortAndLong}' does not take an argument`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function storeOption(longOption, optionValue, options, values) {
|
|
96
|
+
if (longOption === "__proto__") return; /* no prototype pollution */
|
|
97
|
+
const newValue = optionValue ?? true;
|
|
98
|
+
if (options[longOption]?.multiple) {
|
|
99
|
+
if (values[longOption] === undefined) values[longOption] = [newValue];
|
|
100
|
+
else values[longOption].push(newValue);
|
|
101
|
+
} else {
|
|
102
|
+
values[longOption] = newValue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function storeDefaultOption(longOption, optionValue, values) {
|
|
107
|
+
if (longOption === "__proto__") return;
|
|
108
|
+
values[longOption] = optionValue;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** The arguments as tokens: option, positional and option-terminator, with their indexes. */
|
|
112
|
+
function argsToTokens(args, options) {
|
|
113
|
+
const tokens = [];
|
|
114
|
+
let index = -1;
|
|
115
|
+
let groupCount = 0;
|
|
116
|
+
const remainingArgs = args.slice();
|
|
117
|
+
while (remainingArgs.length > 0) {
|
|
118
|
+
const arg = remainingArgs.shift();
|
|
119
|
+
const nextArg = remainingArgs[0];
|
|
120
|
+
if (groupCount > 0) groupCount--;
|
|
121
|
+
else index++;
|
|
122
|
+
|
|
123
|
+
/* everything after a bare `--` is a positional */
|
|
124
|
+
if (arg === "--") {
|
|
125
|
+
tokens.push({ kind: "option-terminator", index });
|
|
126
|
+
for (const a of remainingArgs) tokens.push({ kind: "positional", index: ++index, value: a });
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (isLoneShortOption(arg)) {
|
|
131
|
+
const shortOption = arg[1];
|
|
132
|
+
const longOption = findLongOptionForShort(shortOption, options);
|
|
133
|
+
let value;
|
|
134
|
+
let inlineValue;
|
|
135
|
+
if (options[longOption]?.type === "string" && isOptionValue(nextArg)) {
|
|
136
|
+
value = remainingArgs.shift();
|
|
137
|
+
inlineValue = false;
|
|
138
|
+
}
|
|
139
|
+
tokens.push({ kind: "option", name: longOption, rawName: arg, index, value, inlineValue });
|
|
140
|
+
if (value != null) ++index;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (isShortOptionGroup(arg, options)) {
|
|
145
|
+
/* `-abc`: each, the last of which may take the rest as its value */
|
|
146
|
+
const expanded = [];
|
|
147
|
+
for (let i = 1; i < arg.length; i++) {
|
|
148
|
+
const shortOption = arg[i];
|
|
149
|
+
const longOption = findLongOptionForShort(shortOption, options);
|
|
150
|
+
if (options[longOption]?.type !== "string" || i === arg.length - 1) {
|
|
151
|
+
expanded.push(`-${shortOption}`);
|
|
152
|
+
} else {
|
|
153
|
+
expanded.push(`-${arg.slice(i)}`);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
remainingArgs.unshift(...expanded);
|
|
158
|
+
groupCount = expanded.length;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (isShortOptionAndValue(arg, options)) {
|
|
163
|
+
const shortOption = arg[1];
|
|
164
|
+
const longOption = findLongOptionForShort(shortOption, options);
|
|
165
|
+
const value = arg.slice(2);
|
|
166
|
+
tokens.push({ kind: "option", name: longOption, rawName: `-${shortOption}`, index, value, inlineValue: true });
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (isLoneLongOption(arg)) {
|
|
171
|
+
const longOption = arg.slice(2);
|
|
172
|
+
let value;
|
|
173
|
+
let inlineValue;
|
|
174
|
+
if (options[longOption]?.type === "string" && isOptionValue(nextArg)) {
|
|
175
|
+
value = remainingArgs.shift();
|
|
176
|
+
inlineValue = false;
|
|
177
|
+
}
|
|
178
|
+
tokens.push({ kind: "option", name: longOption, rawName: arg, index, value, inlineValue });
|
|
179
|
+
if (value != null) ++index;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (isLongOptionAndValue(arg)) {
|
|
184
|
+
const equalIndex = arg.indexOf("=");
|
|
185
|
+
const longOption = arg.slice(2, equalIndex);
|
|
186
|
+
const value = arg.slice(equalIndex + 1);
|
|
187
|
+
tokens.push({ kind: "option", name: longOption, rawName: `--${longOption}`, index, value, inlineValue: true });
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
tokens.push({ kind: "positional", index, value: arg });
|
|
192
|
+
}
|
|
193
|
+
return tokens;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* the arguments when none are given: the process's, after the executable (and the script, when
|
|
197
|
+
* it's Node's) */
|
|
198
|
+
function getMainArgs() {
|
|
199
|
+
const execArgv = process.execArgv ?? [];
|
|
200
|
+
if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
|
|
201
|
+
return process.argv.slice(1);
|
|
202
|
+
}
|
|
203
|
+
return process.argv.slice(2);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** util.parseArgs({ args, options, strict, allowPositionals, allowNegative, tokens }). */
|
|
207
|
+
export function parseArgs(config = { __proto__: null }) {
|
|
208
|
+
const args = config.args ?? getMainArgs();
|
|
209
|
+
const strict = config.strict ?? true;
|
|
210
|
+
const allowPositionals = config.allowPositionals ?? !strict;
|
|
211
|
+
const returnTokens = config.tokens ?? false;
|
|
212
|
+
const allowNegative = config.allowNegative ?? false;
|
|
213
|
+
const options = config.options ?? { __proto__: null };
|
|
214
|
+
const parseConfig = { args, strict, options, allowPositionals, allowNegative };
|
|
215
|
+
|
|
216
|
+
validateArray(args, "args");
|
|
217
|
+
validateBoolean(strict, "strict");
|
|
218
|
+
validateBoolean(allowPositionals, "allowPositionals");
|
|
219
|
+
validateBoolean(returnTokens, "tokens");
|
|
220
|
+
validateBoolean(allowNegative, "allowNegative");
|
|
221
|
+
validateObject(options, "options");
|
|
222
|
+
for (const [longOption, optionConfig] of Object.entries(options)) {
|
|
223
|
+
validateObject(optionConfig, `options.${longOption}`);
|
|
224
|
+
validateUnion(optionConfig.type, `options.${longOption}.type`, ["string", "boolean"]);
|
|
225
|
+
if (Object.hasOwn(optionConfig, "short")) {
|
|
226
|
+
const shortOption = optionConfig.short;
|
|
227
|
+
validateString(shortOption, `options.${longOption}.short`);
|
|
228
|
+
if (shortOption.length !== 1) {
|
|
229
|
+
throw invalidArgValue(`options.${longOption}.short`, "must be a single character", shortOption);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const multipleOption = optionConfig.multiple;
|
|
233
|
+
if (Object.hasOwn(optionConfig, "multiple")) validateBoolean(multipleOption, `options.${longOption}.multiple`);
|
|
234
|
+
const defaultValue = optionConfig.default;
|
|
235
|
+
if (defaultValue !== undefined) {
|
|
236
|
+
let validator;
|
|
237
|
+
switch (optionConfig.type) {
|
|
238
|
+
case "string":
|
|
239
|
+
validator = multipleOption ? validateStringArray : validateString;
|
|
240
|
+
break;
|
|
241
|
+
case "boolean":
|
|
242
|
+
validator = multipleOption ? validateBooleanArray : validateBoolean;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
validator(defaultValue, `options.${longOption}.default`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const tokens = argsToTokens(args, options);
|
|
250
|
+
const result = { values: { __proto__: null }, positionals: [] };
|
|
251
|
+
if (returnTokens) result.tokens = tokens;
|
|
252
|
+
|
|
253
|
+
for (const token of tokens) {
|
|
254
|
+
if (token.kind === "option") {
|
|
255
|
+
if (allowNegative && token.name.startsWith("no-")) {
|
|
256
|
+
/* --no-foo: foo false, when foo is a boolean option */
|
|
257
|
+
const longOption = token.name.slice(3);
|
|
258
|
+
const optionConfig = options[longOption];
|
|
259
|
+
if (optionConfig?.type === "boolean") {
|
|
260
|
+
if (token.value !== undefined) {
|
|
261
|
+
throw codeError(TypeError, "ERR_PARSE_ARGS_INVALID_OPTION_VALUE", `Option '--${longOption}' does not take an argument`);
|
|
262
|
+
}
|
|
263
|
+
storeOption(longOption, false, options, result.values);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (strict) {
|
|
268
|
+
checkOptionUsage(parseConfig, token);
|
|
269
|
+
checkOptionLikeValue(token);
|
|
270
|
+
}
|
|
271
|
+
storeOption(token.name, token.value, options, result.values);
|
|
272
|
+
} else if (token.kind === "positional") {
|
|
273
|
+
if (!allowPositionals) {
|
|
274
|
+
throw codeError(TypeError, "ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL", `Unexpected argument '${token.value}'. This command does not take positional arguments`);
|
|
275
|
+
}
|
|
276
|
+
result.positionals.push(token.value);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
for (const [longOption, optionConfig] of Object.entries(options)) {
|
|
281
|
+
const mustSetDefault = useDefaultValueOption(longOption, optionConfig, result.values);
|
|
282
|
+
if (mustSetDefault) storeDefaultOption(longOption, optionConfig.default, result.values);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
features.parseArgs = parseArgs;
|