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
package/node/prelude/http2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node:http2
|
|
1
|
+
// node:http2: only what code that supports both HTTP versions touches when it
|
|
2
2
|
// runs on HTTP/1 — the request and response classes (for instanceof checks, which never match
|
|
3
3
|
// here) and the constants. Servers and sessions aren't provided: creating one throws.
|
|
4
4
|
import { notSupported } from "./internal/errors.js";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// node:https (Node's lib/https.js): HTTP over TLS. Server is a tls.Server whose secure connections
|
|
2
|
+
// get http.Server's requests (llhttp fed the decrypted bytes: http.js's fed connections); Agent is
|
|
3
|
+
// http.Agent connecting with tls.connect, reusing TLS sessions by origin; request and get are
|
|
4
|
+
// http's, with https's agent and port 443.
|
|
5
|
+
// Ported from Node.js (Copyright Node.js contributors, MIT): node/third_party/nodejs/LICENSE.
|
|
6
|
+
import { Agent as HttpAgent, ClientRequest, Server as HttpServer } from "./http.js";
|
|
7
|
+
import { invalidArgType } from "./internal/errors.js";
|
|
8
|
+
import { Server as TlsServer, connect as tlsConnect } from "./tls.js";
|
|
9
|
+
import { urlToHttpOptions } from "./url.js";
|
|
10
|
+
import { callableClass } from "./internal/features.js";
|
|
11
|
+
|
|
12
|
+
/* ---- Server ------------------------------------------------------------------------------------- */
|
|
13
|
+
|
|
14
|
+
class ServerClass extends TlsServer {
|
|
15
|
+
constructor(options, requestListener) {
|
|
16
|
+
if (typeof options === "function") {
|
|
17
|
+
requestListener = options;
|
|
18
|
+
options = {};
|
|
19
|
+
} else if (options === undefined || options === null) {
|
|
20
|
+
options = {};
|
|
21
|
+
} else if (typeof options !== "object") {
|
|
22
|
+
throw invalidArgType("options", "of type object", options);
|
|
23
|
+
}
|
|
24
|
+
super({ noDelay: true, ALPNProtocols: ["http/1.1"], ...options });
|
|
25
|
+
this._initHttp(options, requestListener, "secureConnection");
|
|
26
|
+
/* a handshake that fails is the client's error, as a request that does */
|
|
27
|
+
this.on("tlsClientError", (err, conn) => {
|
|
28
|
+
if (!this.emit("clientError", err, conn)) conn.destroy(err);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export const Server = callableClass(ServerClass, "Server"); /* Server(…) without new, as Node's */
|
|
33
|
+
|
|
34
|
+
/* http.Server's methods: its requests, timeouts and connections */
|
|
35
|
+
for (const key of Object.getOwnPropertyNames(HttpServer.prototype)) {
|
|
36
|
+
if (key === "constructor" || Object.hasOwn(Server.prototype, key)) continue;
|
|
37
|
+
Object.defineProperty(Server.prototype, key, Object.getOwnPropertyDescriptor(HttpServer.prototype, key));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function createServer(options, requestListener) {
|
|
41
|
+
return new Server(options, requestListener);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ---- Agent -------------------------------------------------------------------------------------- */
|
|
45
|
+
|
|
46
|
+
/* tls.connect with the agent's options, resuming the origin's last session */
|
|
47
|
+
function createConnection(port, host, options) {
|
|
48
|
+
if (port !== null && typeof port === "object") options = port;
|
|
49
|
+
else if (host !== null && typeof host === "object") options = { ...host };
|
|
50
|
+
else if (options === null || typeof options !== "object") options = {};
|
|
51
|
+
else options = { ...options };
|
|
52
|
+
if (typeof port === "number") options.port = port;
|
|
53
|
+
if (typeof host === "string") options.host = host;
|
|
54
|
+
if (options._agentKey) {
|
|
55
|
+
const session = this._getSession(options._agentKey);
|
|
56
|
+
if (session) options = { session, ...options };
|
|
57
|
+
}
|
|
58
|
+
const socket = tlsConnect(options);
|
|
59
|
+
if (options._agentKey) {
|
|
60
|
+
socket.on("session", (session) => this._cacheSession(options._agentKey, session));
|
|
61
|
+
socket.once("close", (err) => {
|
|
62
|
+
if (err) this._evictSession(options._agentKey);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return socket;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** http.Agent over TLS: port 443, and the TLS options in each origin's name. */
|
|
69
|
+
export function Agent(options) {
|
|
70
|
+
if (!(this instanceof Agent)) return new Agent(options);
|
|
71
|
+
HttpAgent.call(this, options);
|
|
72
|
+
this.defaultPort = 443;
|
|
73
|
+
this.protocol = "https:";
|
|
74
|
+
this.maxCachedSessions = this.options.maxCachedSessions;
|
|
75
|
+
if (this.maxCachedSessions === undefined) this.maxCachedSessions = 100;
|
|
76
|
+
this._sessionCache = { map: {}, list: [] };
|
|
77
|
+
}
|
|
78
|
+
Object.setPrototypeOf(Agent.prototype, HttpAgent.prototype);
|
|
79
|
+
Object.setPrototypeOf(Agent, HttpAgent);
|
|
80
|
+
Agent.prototype.createConnection = createConnection;
|
|
81
|
+
|
|
82
|
+
/* the origin with what makes its TLS connections differ: sockets aren't shared across them */
|
|
83
|
+
const nameOptions = ["ca", "cert", "clientCertEngine", "ciphers", "key", "pfx", "rejectUnauthorized", "servername", "minVersion",
|
|
84
|
+
"maxVersion", "secureProtocol", "crl", "honorCipherOrder", "ecdhCurve", "dhparam", "secureOptions", "sessionIdContext", "sigalgs",
|
|
85
|
+
"privateKeyIdentifier", "privateKeyEngine"];
|
|
86
|
+
|
|
87
|
+
Agent.prototype.getName = function getName(options = {}) {
|
|
88
|
+
let name = HttpAgent.prototype.getName.call(this, options);
|
|
89
|
+
for (const key of nameOptions) {
|
|
90
|
+
name += ":";
|
|
91
|
+
const value = options[key];
|
|
92
|
+
if (key === "rejectUnauthorized") {
|
|
93
|
+
if (value !== undefined) name += value;
|
|
94
|
+
} else if (key === "servername") {
|
|
95
|
+
if (value && value !== options.host) name += value;
|
|
96
|
+
} else if (value) {
|
|
97
|
+
name += value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return name;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
Agent.prototype._getSession = function _getSession(key) {
|
|
104
|
+
return this._sessionCache.map[key];
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
Agent.prototype._cacheSession = function _cacheSession(key, session) {
|
|
108
|
+
if (this.maxCachedSessions === 0) return;
|
|
109
|
+
if (this._sessionCache.map[key]) {
|
|
110
|
+
this._sessionCache.map[key] = session;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (this._sessionCache.list.length >= this.maxCachedSessions) {
|
|
114
|
+
const oldKey = this._sessionCache.list.shift();
|
|
115
|
+
delete this._sessionCache.map[oldKey];
|
|
116
|
+
}
|
|
117
|
+
this._sessionCache.list.push(key);
|
|
118
|
+
this._sessionCache.map[key] = session;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Agent.prototype._evictSession = function _evictSession(key) {
|
|
122
|
+
const index = this._sessionCache.list.indexOf(key);
|
|
123
|
+
if (index === -1) return;
|
|
124
|
+
this._sessionCache.list.splice(index, 1);
|
|
125
|
+
delete this._sessionCache.map[key];
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export let globalAgent = new Agent({ keepAlive: true, scheduling: "lifo", timeout: 5000 });
|
|
129
|
+
|
|
130
|
+
/* ---- request and get ---------------------------------------------------------------------------- */
|
|
131
|
+
|
|
132
|
+
/** request(url[, options][, callback]) or request(options[, callback]): an http.ClientRequest
|
|
133
|
+
* with https's agent. */
|
|
134
|
+
export function request(...args) {
|
|
135
|
+
let options = {};
|
|
136
|
+
if (typeof args[0] === "string") options = urlToHttpOptions(new URL(args.shift()));
|
|
137
|
+
else if (args[0] instanceof URL) options = urlToHttpOptions(args.shift());
|
|
138
|
+
if (args[0] && typeof args[0] !== "function") Object.assign(options, args.shift());
|
|
139
|
+
options._defaultAgent = globalAgent;
|
|
140
|
+
args.unshift(options);
|
|
141
|
+
return new ClientRequest(...args);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function get(input, options, cb) {
|
|
145
|
+
const req = request(input, options, cb);
|
|
146
|
+
req.end();
|
|
147
|
+
return req;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export default {
|
|
151
|
+
Agent, Server, createServer, get, request,
|
|
152
|
+
/* an accessor, as Node's: a program may replace the agent requests use by default */
|
|
153
|
+
get globalAgent() {
|
|
154
|
+
return globalAgent;
|
|
155
|
+
},
|
|
156
|
+
set globalAgent(value) {
|
|
157
|
+
globalAgent = value;
|
|
158
|
+
},
|
|
159
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// node:inspector: a compiled program has no V8 inspector to connect to. It loads as in a Node
|
|
2
|
+
// process no debugger is attached to: url() is undefined, close() does nothing, console is the
|
|
3
|
+
// global console. What needs the inspector throws when called: open, waitForDebugger and a Session.
|
|
4
|
+
// Code that loads it only to ask whether a debugger is attached (Next.js's server) runs; code that
|
|
5
|
+
// profiles or debugs on request fails when asked (TypeScript's --generateCpuProfile).
|
|
6
|
+
import { notSupported } from "./internal/errors.js";
|
|
7
|
+
|
|
8
|
+
export function open() {
|
|
9
|
+
throw notSupported("inspector.open() (a compiled program has no V8 inspector)");
|
|
10
|
+
}
|
|
11
|
+
export function close() {}
|
|
12
|
+
export function url() {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
export function waitForDebugger() {
|
|
16
|
+
throw notSupported("inspector.waitForDebugger() (a compiled program has no V8 inspector)");
|
|
17
|
+
}
|
|
18
|
+
export const console = globalThis.console;
|
|
19
|
+
export class Session {
|
|
20
|
+
constructor() {
|
|
21
|
+
throw notSupported("inspector.Session (a compiled program has no V8 inspector)");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const Network = {};
|
|
25
|
+
export const NetworkResources = {};
|
|
26
|
+
|
|
27
|
+
export default { open, close, url, waitForDebugger, console, Session, Network, NetworkResources };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The async context
|
|
1
|
+
// The async context: the value the runtime carries through jobs, timers and promise
|
|
2
2
|
// reactions, which node:async_hooks' AsyncLocalStorage keeps its stores in (a frame: a Map from
|
|
3
3
|
// each storage to its store, never changed once current). I/O callbacks run under none: the
|
|
4
4
|
// prelude binds each to the context it was registered in, as Node runs a handle's callbacks in
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// buffer.transcode: bytes in one encoding as bytes in another. Linked into programs that name it
|
|
2
|
+
// (internal/features.js).
|
|
3
|
+
import { features } from "./features.js";
|
|
4
|
+
|
|
5
|
+
/* transcode's encodings, by Buffer's names for them */
|
|
6
|
+
const transcodable = { ascii: "ascii", latin1: "latin1", binary: "latin1", ucs2: "utf16le", "ucs-2": "utf16le", utf16le: "utf16le", "utf-16le": "utf16le", utf8: "utf8", "utf-8": "utf8" };
|
|
7
|
+
|
|
8
|
+
/** The bytes in one encoding as bytes in another: ascii, latin1, ucs2 or utf8. A character the
|
|
9
|
+
* target can't hold becomes "?", as Node's (ICU's) transcode makes it. */
|
|
10
|
+
function transcode(source, fromEncoding, toEncoding) {
|
|
11
|
+
if (!(source instanceof Uint8Array)) {
|
|
12
|
+
const e = new TypeError(`The "source" argument must be an instance of Buffer or Uint8Array.${received(source)}`);
|
|
13
|
+
e.code = "ERR_INVALID_ARG_TYPE";
|
|
14
|
+
throw e;
|
|
15
|
+
}
|
|
16
|
+
if (source.length === 0) return Buffer.alloc(0);
|
|
17
|
+
const from = transcodable[String(fromEncoding).toLowerCase()];
|
|
18
|
+
const to = transcodable[String(toEncoding).toLowerCase()];
|
|
19
|
+
if (from === undefined || to === undefined) {
|
|
20
|
+
const e = new Error("Unable to transcode Buffer [U_ILLEGAL_ARGUMENT_ERROR]");
|
|
21
|
+
e.code = "U_ILLEGAL_ARGUMENT_ERROR";
|
|
22
|
+
e.errno = 1;
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
25
|
+
let text = Buffer.from(source.buffer, source.byteOffset, source.byteLength).toString(from);
|
|
26
|
+
const max = to === "ascii" ? 0x7f : to === "latin1" ? 0xff : -1;
|
|
27
|
+
if (max >= 0) {
|
|
28
|
+
let out = "";
|
|
29
|
+
for (const ch of text) out += ch.codePointAt(0) > max ? "?" : ch;
|
|
30
|
+
text = out;
|
|
31
|
+
}
|
|
32
|
+
return Buffer.from(text, to);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Node's "Received …" for the message */
|
|
36
|
+
function received(value) {
|
|
37
|
+
if (value === null || value === undefined) return ` Received ${value}`;
|
|
38
|
+
if (typeof value === "function") return ` Received function ${value.name}`;
|
|
39
|
+
if (typeof value === "object") return ` Received an instance of ${value.constructor?.name ?? "Object"}`;
|
|
40
|
+
const shown = typeof value === "string" ? `'${value.length > 25 ? value.slice(0, 25) + "..." : value}'` : String(value);
|
|
41
|
+
return ` Received type ${typeof value} (${shown})`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
features.transcode = transcode;
|