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,404 @@
|
|
|
1
|
+
// node:test's reporters: Node's tap and spec reporters (lib/internal/
|
|
2
|
+
// test_runner/reporter/tap.js, spec.js, utils.js; MIT; spec as Node v24.21.0's), ported from streams to
|
|
3
|
+
// objects that turn each test event into text. spec is the default, as in Node 24 (tap is
|
|
4
|
+
// node:test/reporters'). Errors carry no stack frames and tests no location: a compiled
|
|
5
|
+
// program knows neither (Node prints the test's file:line:column and V8's frames).
|
|
6
|
+
// Ported from Node.js (Copyright Node.js contributors, MIT): node/third_party/nodejs/LICENSE.
|
|
7
|
+
import { utilInspect as inspect } from "visaljs:host";
|
|
8
|
+
import { isError } from "../comparisons.js";
|
|
9
|
+
|
|
10
|
+
/** Node's inspectWithNoCustomRetry: util.inspect, again without custom inspectors if one throws. */
|
|
11
|
+
export function inspectWithNoCustomRetry(obj, options) {
|
|
12
|
+
try {
|
|
13
|
+
return inspect(obj, options);
|
|
14
|
+
} catch {
|
|
15
|
+
return inspect(obj, { ...options, customInspect: false });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Node's internal/util/colors: ANSI colors when stderr is a color terminal */
|
|
20
|
+
export function colorsFor(stream) {
|
|
21
|
+
const env = process.env;
|
|
22
|
+
let on;
|
|
23
|
+
if (env.FORCE_COLOR !== undefined) on = env.FORCE_COLOR !== "0" && env.FORCE_COLOR !== "false";
|
|
24
|
+
else on = Boolean(stream?.isTTY) && env.NO_COLOR === undefined && env.NODE_DISABLE_COLORS === undefined && env.TERM !== "dumb";
|
|
25
|
+
const c = (code) => (on ? `\u001b[${code}m` : "");
|
|
26
|
+
return { blue: c(34), green: c(32), white: c(39), yellow: c(33), red: c(31), gray: c(90), reset: c(0), hasColors: on };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ---- tap (lib/internal/test_runner/reporter/tap.js) -------------------------------------------
|
|
30
|
+
|
|
31
|
+
const kDefaultIndent = " "; // 4 spaces
|
|
32
|
+
const kFrameStartRegExp = /^ {4}at /;
|
|
33
|
+
const kLineBreakRegExp = /\n|\r\n/;
|
|
34
|
+
const kDefaultTAPVersion = 13;
|
|
35
|
+
const tapInspectOptions = { __proto__: null, colors: false, breakLength: Infinity };
|
|
36
|
+
const kUnwrapErrors = new Set(["testCodeFailure", "hookFailed", "uncaughtException", "unhandledRejection"]);
|
|
37
|
+
|
|
38
|
+
export class TapReporter {
|
|
39
|
+
start() {
|
|
40
|
+
return `TAP version ${kDefaultTAPVersion}\n`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handle({ type, data }) {
|
|
44
|
+
switch (type) {
|
|
45
|
+
case "test:fail": {
|
|
46
|
+
const location = data.file ? `${data.file}:${data.line}:${data.column}` : null;
|
|
47
|
+
return reportTest(data.nesting, data.testNumber, "not ok", data.name, data.skip, data.todo) + reportDetails(data.nesting, data.details, location);
|
|
48
|
+
}
|
|
49
|
+
case "test:pass":
|
|
50
|
+
return reportTest(data.nesting, data.testNumber, "ok", data.name, data.skip, data.todo) + reportDetails(data.nesting, data.details, null);
|
|
51
|
+
case "test:plan":
|
|
52
|
+
return `${indent(data.nesting)}1..${data.count}\n`;
|
|
53
|
+
case "test:start":
|
|
54
|
+
return `${indent(data.nesting)}# Subtest: ${tapEscape(data.name)}\n`;
|
|
55
|
+
case "test:stderr":
|
|
56
|
+
case "test:stdout": {
|
|
57
|
+
const lines = data.message.split(kLineBreakRegExp);
|
|
58
|
+
let out = "";
|
|
59
|
+
for (let i = 0; i < lines.length; i++) {
|
|
60
|
+
if (lines[i].length === 0) continue;
|
|
61
|
+
out += `# ${tapEscape(lines[i])}\n`;
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
case "test:diagnostic":
|
|
66
|
+
return `${indent(data.nesting)}# ${tapEscape(data.message)}\n`;
|
|
67
|
+
}
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
flush() {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function reportTest(nesting, testNumber, status, name, skip, todo) {
|
|
77
|
+
let line = `${indent(nesting)}${status} ${testNumber}`;
|
|
78
|
+
|
|
79
|
+
if (name) {
|
|
80
|
+
line += ` ${tapEscape(`- ${name}`)}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (skip !== undefined) {
|
|
84
|
+
line += ` # SKIP${typeof skip === "string" && skip.length ? ` ${tapEscape(skip)}` : ""}`;
|
|
85
|
+
} else if (todo !== undefined) {
|
|
86
|
+
line += ` # TODO${typeof todo === "string" && todo.length ? ` ${tapEscape(todo)}` : ""}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
line += "\n";
|
|
90
|
+
|
|
91
|
+
return line;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function reportDetails(nesting, data = {}, location) {
|
|
95
|
+
const { error, duration_ms } = data;
|
|
96
|
+
const _indent = indent(nesting);
|
|
97
|
+
let details = `${_indent} ---\n`;
|
|
98
|
+
|
|
99
|
+
details += jsToYaml(_indent, "duration_ms", duration_ms);
|
|
100
|
+
details += jsToYaml(_indent, "type", data.type);
|
|
101
|
+
|
|
102
|
+
if (location) {
|
|
103
|
+
details += jsToYaml(_indent, "location", location);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
details += jsToYaml(_indent, null, error, new Set());
|
|
107
|
+
details += `${_indent} ...\n`;
|
|
108
|
+
return details;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const memo = new Map();
|
|
112
|
+
function indent(nesting) {
|
|
113
|
+
let value = memo.get(nesting);
|
|
114
|
+
if (value === undefined) {
|
|
115
|
+
value = kDefaultIndent.repeat(nesting);
|
|
116
|
+
memo.set(nesting, value);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// In certain places, # and \ need to be escaped as \# and \\.
|
|
123
|
+
function tapEscape(input) {
|
|
124
|
+
let result = input.replaceAll("\b", "\\b");
|
|
125
|
+
result = result.replaceAll("\f", "\\f");
|
|
126
|
+
result = result.replaceAll("\t", "\\t");
|
|
127
|
+
result = result.replaceAll("\n", "\\n");
|
|
128
|
+
result = result.replaceAll("\r", "\\r");
|
|
129
|
+
result = result.replaceAll("\v", "\\v");
|
|
130
|
+
result = result.replaceAll("\\", "\\\\");
|
|
131
|
+
result = result.replaceAll("#", "\\#");
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function jsToYaml(indent, name, value, seen) {
|
|
136
|
+
if (value === undefined) {
|
|
137
|
+
return "";
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const prefix = `${indent} ${name}:`;
|
|
141
|
+
|
|
142
|
+
if (value === null) {
|
|
143
|
+
return `${prefix} ~\n`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (typeof value !== "object") {
|
|
147
|
+
if (typeof value !== "string") {
|
|
148
|
+
return `${prefix} ${inspectWithNoCustomRetry(value, tapInspectOptions)}\n`;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const lines = value.split(kLineBreakRegExp);
|
|
152
|
+
|
|
153
|
+
if (lines.length === 1) {
|
|
154
|
+
return `${prefix} ${inspectWithNoCustomRetry(value, tapInspectOptions)}\n`;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let str = `${prefix} |-\n`;
|
|
158
|
+
|
|
159
|
+
for (let i = 0; i < lines.length; i++) {
|
|
160
|
+
str += `${indent} ${lines[i]}\n`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return str;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
seen.add(value);
|
|
167
|
+
const entries = Object.entries(value);
|
|
168
|
+
const isErrorObj = isError(value);
|
|
169
|
+
let propsIndent = indent;
|
|
170
|
+
let result = "";
|
|
171
|
+
|
|
172
|
+
if (name != null) {
|
|
173
|
+
result += prefix;
|
|
174
|
+
if (value instanceof Date) {
|
|
175
|
+
// YAML uses the ISO-8601 standard to express dates.
|
|
176
|
+
result += " " + value.toISOString();
|
|
177
|
+
}
|
|
178
|
+
result += "\n";
|
|
179
|
+
propsIndent += " ";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
for (let i = 0; i < entries.length; i++) {
|
|
183
|
+
const { 0: key, 1: value } = entries[i];
|
|
184
|
+
|
|
185
|
+
if (isErrorObj && (key === "cause" || key === "code")) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (seen.has(value)) {
|
|
189
|
+
result += `${propsIndent} ${key}: <Circular>\n`;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
result += jsToYaml(propsIndent, key, value, seen);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (isErrorObj) {
|
|
197
|
+
const { cause, code, failureType, message, expected, actual, operator, stack, name } = value;
|
|
198
|
+
let errMsg = message ?? "<unknown error>";
|
|
199
|
+
let errName = name;
|
|
200
|
+
let errStack = stack;
|
|
201
|
+
let errCode = code;
|
|
202
|
+
let errExpected = expected;
|
|
203
|
+
let errActual = actual;
|
|
204
|
+
let errOperator = operator;
|
|
205
|
+
let errIsAssertion = isAssertionLike(value);
|
|
206
|
+
|
|
207
|
+
// If the ERR_TEST_FAILURE came from an error provided by user code,
|
|
208
|
+
// then try to unwrap the original error message and stack.
|
|
209
|
+
if (code === "ERR_TEST_FAILURE" && kUnwrapErrors.has(failureType)) {
|
|
210
|
+
errStack = cause?.stack ?? errStack;
|
|
211
|
+
errCode = cause?.code ?? errCode;
|
|
212
|
+
errName = cause?.name ?? errName;
|
|
213
|
+
errMsg = cause?.message ?? errMsg;
|
|
214
|
+
|
|
215
|
+
if (isAssertionLike(cause)) {
|
|
216
|
+
errExpected = cause.expected;
|
|
217
|
+
errActual = cause.actual;
|
|
218
|
+
errOperator = cause.operator ?? errOperator;
|
|
219
|
+
errIsAssertion = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
result += jsToYaml(indent, "error", errMsg, seen);
|
|
224
|
+
|
|
225
|
+
if (errCode) {
|
|
226
|
+
result += jsToYaml(indent, "code", errCode, seen);
|
|
227
|
+
}
|
|
228
|
+
if (errName && errName !== "Error") {
|
|
229
|
+
result += jsToYaml(indent, "name", errName, seen);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (errIsAssertion) {
|
|
233
|
+
// Note that we're deliberately creating shallow copies of the `seen`
|
|
234
|
+
// set here in order to isolate the discovery of circular references
|
|
235
|
+
// within the expected and actual properties respectively.
|
|
236
|
+
result += jsToYaml(indent, "expected", errExpected, new Set(seen));
|
|
237
|
+
result += jsToYaml(indent, "actual", errActual, new Set(seen));
|
|
238
|
+
if (errOperator) {
|
|
239
|
+
result += jsToYaml(indent, "operator", errOperator, seen);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (typeof errStack === "string") {
|
|
244
|
+
const frames = [];
|
|
245
|
+
|
|
246
|
+
for (const frame of errStack.split(kLineBreakRegExp)) {
|
|
247
|
+
const processed = frame.replace(kFrameStartRegExp, "");
|
|
248
|
+
|
|
249
|
+
if (processed.length > 0 && processed.length !== frame.length) {
|
|
250
|
+
frames.push(processed);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (frames.length > 0) {
|
|
255
|
+
const frameDelimiter = `\n${indent} `;
|
|
256
|
+
|
|
257
|
+
result += `${indent} stack: |-${frameDelimiter}`;
|
|
258
|
+
result += `${frames.join(frameDelimiter)}\n`;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return result;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function isAssertionLike(value) {
|
|
267
|
+
return value && typeof value === "object" && "expected" in value && "actual" in value;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// ---- spec (lib/internal/test_runner/reporter/spec.js, utils.js) -------------------------------
|
|
271
|
+
|
|
272
|
+
const reporterUnicodeSymbolMap = {
|
|
273
|
+
"__proto__": null,
|
|
274
|
+
"test:fail": "✖ ",
|
|
275
|
+
"test:pass": "✔ ",
|
|
276
|
+
"test:diagnostic": "ℹ ",
|
|
277
|
+
"test:log": "ℹ ",
|
|
278
|
+
"test:coverage": "ℹ ",
|
|
279
|
+
"arrow:right": "▶ ",
|
|
280
|
+
"hyphen:minus": "﹣ ",
|
|
281
|
+
"warning:alert": "⚠ ",
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
function specIndent(nesting) {
|
|
285
|
+
return " ".repeat(nesting);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export class SpecReporter {
|
|
289
|
+
#stack = [];
|
|
290
|
+
#failedTests = [];
|
|
291
|
+
#colors = colorsFor(process.stderr);
|
|
292
|
+
#inspectOptions = { __proto__: null, colors: colorsFor(process.stdout).hasColors, breakLength: Infinity };
|
|
293
|
+
|
|
294
|
+
start() {
|
|
295
|
+
return "";
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
#colorMap(type) {
|
|
299
|
+
const c = this.#colors;
|
|
300
|
+
return { "test:fail": c.red, "test:pass": c.green, "test:diagnostic": c.blue, "test:log": c.blue, info: c.blue, warn: c.yellow, error: c.red }[type];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#formatError(error, indent) {
|
|
304
|
+
const err = error.code === "ERR_TEST_FAILURE" ? error.cause : error;
|
|
305
|
+
const message = inspectWithNoCustomRetry(err, this.#inspectOptions).split(/\r?\n/).join(`\n${indent} `);
|
|
306
|
+
return `\n${indent} ${message}\n`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Node 24's utils.js formatTestReport */
|
|
310
|
+
#formatTestReport(type, data, showErrorDetails = true, prefix = "", indent = "") {
|
|
311
|
+
const colors = this.#colors;
|
|
312
|
+
let color = this.#colorMap(type) ?? colors.white;
|
|
313
|
+
let symbol = reporterUnicodeSymbolMap[type] ?? " ";
|
|
314
|
+
const { skip, todo, expectFailure } = data;
|
|
315
|
+
const duration_ms = data.details?.duration_ms ? ` ${colors.gray}(${data.details.duration_ms}ms)${colors.white}` : "";
|
|
316
|
+
const replayed = data.details?.passed_on_attempt !== undefined
|
|
317
|
+
? ` ${colors.gray}(passed on attempt ${data.details.passed_on_attempt})${colors.white}`
|
|
318
|
+
: "";
|
|
319
|
+
let title = `${data.name}${duration_ms}${replayed}`;
|
|
320
|
+
|
|
321
|
+
if (skip !== undefined) {
|
|
322
|
+
title += ` # ${typeof skip === "string" && skip.length ? skip : "SKIP"}`;
|
|
323
|
+
color = colors.gray;
|
|
324
|
+
symbol = reporterUnicodeSymbolMap["hyphen:minus"];
|
|
325
|
+
} else if (todo !== undefined) {
|
|
326
|
+
title += ` # ${typeof todo === "string" && todo.length ? todo : "TODO"}`;
|
|
327
|
+
if (type === "test:fail") {
|
|
328
|
+
color = colors.yellow;
|
|
329
|
+
symbol = reporterUnicodeSymbolMap["warning:alert"];
|
|
330
|
+
}
|
|
331
|
+
} else if (expectFailure !== undefined) {
|
|
332
|
+
title += " # EXPECTED FAILURE";
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const err = showErrorDetails && data.details?.error ? this.#formatError(data.details.error, indent) : "";
|
|
336
|
+
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
#formatFailedTestResults() {
|
|
340
|
+
if (this.#failedTests.length === 0) {
|
|
341
|
+
return "";
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const results = [`\n${this.#colorMap("test:fail")}${reporterUnicodeSymbolMap["test:fail"]}failing tests:${this.#colors.white}\n`];
|
|
345
|
+
|
|
346
|
+
for (let i = 0; i < this.#failedTests.length; i++) {
|
|
347
|
+
results.push(this.#formatTestReport("test:fail", this.#failedTests[i]));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
this.#failedTests = []; // Clean up the failed tests
|
|
351
|
+
return results.join("\n");
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
#handleTestReportEvent(type, data) {
|
|
355
|
+
this.#stack.shift(); // This is the matching `test:start` event
|
|
356
|
+
let prefix = "";
|
|
357
|
+
while (this.#stack.length) {
|
|
358
|
+
// Report all the parent `test:start` events
|
|
359
|
+
const parent = this.#stack.pop();
|
|
360
|
+
const msg = parent.data;
|
|
361
|
+
prefix += `${specIndent(msg.nesting)}${reporterUnicodeSymbolMap["arrow:right"]}${msg.name}\n`;
|
|
362
|
+
}
|
|
363
|
+
const indentation = specIndent(data.nesting);
|
|
364
|
+
return `${this.#formatTestReport(type, data, false, prefix, indentation)}\n`;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
handle({ type, data }) {
|
|
368
|
+
switch (type) {
|
|
369
|
+
case "test:fail":
|
|
370
|
+
if (data.details?.error?.failureType !== "subtestsFailed") {
|
|
371
|
+
this.#failedTests.push(data);
|
|
372
|
+
}
|
|
373
|
+
return this.#handleTestReportEvent(type, data);
|
|
374
|
+
case "test:pass":
|
|
375
|
+
return this.#handleTestReportEvent(type, data);
|
|
376
|
+
case "test:start":
|
|
377
|
+
this.#stack.unshift({ __proto__: null, data, type });
|
|
378
|
+
break;
|
|
379
|
+
case "test:stderr":
|
|
380
|
+
case "test:stdout":
|
|
381
|
+
return data.message;
|
|
382
|
+
case "test:diagnostic":
|
|
383
|
+
case "test:log": {
|
|
384
|
+
const diagnosticColor = this.#colorMap(data.level) || this.#colorMap(type);
|
|
385
|
+
return `${diagnosticColor}${specIndent(data.nesting)}${reporterUnicodeSymbolMap[type]}${data.message}${this.#colors.white}\n`;
|
|
386
|
+
}
|
|
387
|
+
case "test:summary":
|
|
388
|
+
// We report only the root test summary
|
|
389
|
+
if (data.file === undefined) {
|
|
390
|
+
return this.#formatFailedTestResults();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return "";
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
flush() {
|
|
397
|
+
return this.#formatFailedTestResults();
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/** A failed test as the dot reporter lists it (utils.js' formatTestReport). */
|
|
401
|
+
formatTestReport(type, data) {
|
|
402
|
+
return this.#formatTestReport(type, data);
|
|
403
|
+
}
|
|
404
|
+
}
|