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
package/runtime/src/builtins.c
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Function.prototype, Array, String, Number and Boolean basics. */
|
|
1
|
+
/* Core built-ins: Object, Function.prototype, Array, String, Number and Boolean basics. */
|
|
3
2
|
#include <math.h>
|
|
4
3
|
#include <stdio.h>
|
|
5
4
|
#include <stdlib.h>
|
|
@@ -249,7 +248,7 @@ static JSValue define_properties(JSContext *ctx, JSValue o, JSValue props) {
|
|
|
249
248
|
js_store(ctx, &descs->cell, &descs->values[4 * count + 1], ds[count].value);
|
|
250
249
|
js_store(ctx, &descs->cell, &descs->values[4 * count + 2], ds[count].get);
|
|
251
250
|
js_store(ctx, &descs->cell, &descs->values[4 * count + 3], ds[count].set);
|
|
252
|
-
keys->values[count] = keys->values[i];
|
|
251
|
+
keys->values[count] = keys->values[i]; /* barrier: same owner */
|
|
253
252
|
count++;
|
|
254
253
|
}
|
|
255
254
|
for (uint32_t i = 0; i < count; i++)
|
|
@@ -860,12 +859,39 @@ BUILTIN(function_proto_to_string) {
|
|
|
860
859
|
return js_concat(ctx, s, cstr(ctx, "() { [native code] }"));
|
|
861
860
|
}
|
|
862
861
|
|
|
863
|
-
/* Function(...) compiles source text at runtime: that needs eval, a non-goal
|
|
862
|
+
/* Function(...) compiles source text at runtime: that needs eval, a non-goal. */
|
|
864
863
|
BUILTIN(function_ctor) {
|
|
865
864
|
UNUSED_ARGS;
|
|
866
865
|
return js_throw_type_error(ctx, "Function() constructor needs eval, which isn't supported");
|
|
867
866
|
}
|
|
868
867
|
|
|
868
|
+
/* %GeneratorFunction%, %AsyncFunction% and %AsyncGeneratorFunction% (§27.3.1, §27.7.1, §27.4.1): a
|
|
869
|
+
* kind of function's constructor, which compiles source text as Function() does, so throws as it
|
|
870
|
+
* does. Not globals: reached as a function's prototype's constructor, as `instanceof` needs. */
|
|
871
|
+
#define FUNCTION_KIND_CTOR(fn, name) \
|
|
872
|
+
BUILTIN(fn) { \
|
|
873
|
+
UNUSED_ARGS; \
|
|
874
|
+
return js_throw_type_error(ctx, name "() constructor needs eval, which isn't supported"); \
|
|
875
|
+
}
|
|
876
|
+
FUNCTION_KIND_CTOR(generator_function_ctor, "GeneratorFunction")
|
|
877
|
+
FUNCTION_KIND_CTOR(async_function_ctor, "AsyncFunction")
|
|
878
|
+
FUNCTION_KIND_CTOR(async_generator_function_ctor, "AsyncGeneratorFunction")
|
|
879
|
+
|
|
880
|
+
/* The constructor of a kind of function, its prototype `proto`: [[Prototype]] %Function%, its
|
|
881
|
+
* `prototype` fixed, proto's `constructor` it (not writable, configurable). */
|
|
882
|
+
void js_define_function_kind_ctor(JSContext *ctx, JSValue proto, int kind) {
|
|
883
|
+
static const struct { const char *name; JSNativeFn fn; } KINDS[] = {
|
|
884
|
+
{ "GeneratorFunction", generator_function_ctor },
|
|
885
|
+
{ "AsyncFunction", async_function_ctor },
|
|
886
|
+
{ "AsyncGeneratorFunction", async_generator_function_ctor },
|
|
887
|
+
};
|
|
888
|
+
JSValue ctor = js_new_native(ctx, KINDS[kind].fn, js_atom_from_cstr(ctx, KINDS[kind].name), 1, JS_FN_STRICT | JS_FN_CONSTRUCTOR);
|
|
889
|
+
JSValue function = js_get_value(ctx, ctx->intrinsics[JS_INTRINSIC_FUNCTION_PROTOTYPE], JS_ATOM(constructor));
|
|
890
|
+
if (js_is_object(function) && js_set_prototype_of(ctx, js_as_object(ctor), function) < 0) js_discard(js_take_exception(ctx));
|
|
891
|
+
js_define_data(ctx, js_as_object(ctor), JS_ATOM(prototype), proto, 0);
|
|
892
|
+
js_define_data(ctx, js_as_object(proto), JS_ATOM(constructor), ctor, JS_PROP_CONFIGURABLE);
|
|
893
|
+
}
|
|
894
|
+
|
|
869
895
|
/* eval (§19.2.1): a non-string comes back as is; source text would need compiling at run time.
|
|
870
896
|
* Present so code can reference it (get-intrinsic lists %eval%). */
|
|
871
897
|
CORE(global_eval) {
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Map and Set (ECMAScript §24.1–24.2), an optional component
|
|
1
|
+
/* Map and Set (ECMAScript §24.1–24.2), an optional component: with Map.groupBy,
|
|
2
2
|
* Map.prototype.getOrInsert / getOrInsertComputed, and the Set methods (union, …).
|
|
3
3
|
*
|
|
4
4
|
* Each Map or Set holds an ordered hash table (V8's OrderedHashTable): the entries in insertion
|
|
@@ -55,7 +55,19 @@ static void table_visit(JSCell *c, JSTracer *trc) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
/* A young collection's visit of a big table's marked cards. */
|
|
59
|
+
static void table_visit_range(JSCell *c, JSTracer *trc, size_t from, size_t to) {
|
|
60
|
+
Table *t = (Table *)c;
|
|
61
|
+
if (from < offsetof(Table, entries)) js_trace_value(trc, t->next);
|
|
62
|
+
size_t first = from < offsetof(Table, entries) ? 0 : (from - offsetof(Table, entries)) / sizeof(Entry);
|
|
63
|
+
size_t last = to <= offsetof(Table, entries) ? 0 : (to - offsetof(Table, entries) + sizeof(Entry) - 1) / sizeof(Entry);
|
|
64
|
+
for (size_t i = first; i < last && i < t->used; i++) {
|
|
65
|
+
js_trace_value(trc, t->entries[i].key);
|
|
66
|
+
js_trace_value(trc, t->entries[i].value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static const JSCellClass table_class = { "OrderedHashTable", table_visit, NULL, table_visit_range };
|
|
59
71
|
|
|
60
72
|
static Table *new_table(JSContext *ctx, uint32_t cap) {
|
|
61
73
|
size_t size = sizeof(Table) + cap * sizeof(Entry) + (cap / 2) * sizeof(uint32_t);
|
|
@@ -97,7 +109,7 @@ static uint32_t table_find(JSContext *ctx, Table *t, JSValue key, uint32_t hash)
|
|
|
97
109
|
|
|
98
110
|
static void table_append(Table *t, JSValue key, JSValue value, uint32_t hash) {
|
|
99
111
|
uint32_t *b = &buckets_of(t)[hash & (t->cap / 2 - 1)];
|
|
100
|
-
t->entries[t->used] = (Entry){ key, value, *b, hash };
|
|
112
|
+
t->entries[t->used] = (Entry){ key, value, *b, hash }; /* barrier: collection_add's, after it */
|
|
101
113
|
*b = t->used++;
|
|
102
114
|
t->count++;
|
|
103
115
|
}
|
|
@@ -135,6 +147,9 @@ static void collection_add(JSContext *ctx, Collection *c, JSValue key, JSValue v
|
|
|
135
147
|
t = table_of(c);
|
|
136
148
|
}
|
|
137
149
|
table_append(t, key, value, hash);
|
|
150
|
+
Entry *e = &t->entries[t->used - 1];
|
|
151
|
+
js_write_barrier(ctx, &t->host.cell, &e->key, key);
|
|
152
|
+
js_write_barrier(ctx, &t->host.cell, &e->value, value);
|
|
138
153
|
}
|
|
139
154
|
|
|
140
155
|
/* Sets key's value (adding it at the end if new). */
|
package/runtime/src/components.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Every component
|
|
1
|
+
/* Every component: the test host installs them all. Programs name only the ones
|
|
2
2
|
* they reach, so nothing in a program's binary references this list. */
|
|
3
3
|
#include "js_builtins.h"
|
|
4
4
|
|
package/runtime/src/console.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* The global console
|
|
1
|
+
/* The global console, natively: Node's methods and output, formatted by
|
|
2
2
|
* inspect.c. Also the test host's print and the uncaught-error report. */
|
|
3
3
|
#include "js_console.h"
|
|
4
4
|
|
|
@@ -55,6 +55,10 @@ void js_write_output(JSContext *ctx, int fd, JSValue s) {
|
|
|
55
55
|
if (buf != small) free(buf);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
void js_write_bytes(int fd, const uint8_t *data, size_t length) {
|
|
59
|
+
fwrite(data, 1, length, stream(fd));
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
/* console.group's indentation, in spaces */
|
|
59
63
|
static size_t group_indent;
|
|
60
64
|
|
|
@@ -244,13 +248,14 @@ static void format_time(char *out, size_t cap, double ms) {
|
|
|
244
248
|
static JSValue print_time(JSContext *ctx, JSValue label, double start, uint32_t extra, const JSValue *data) {
|
|
245
249
|
char t[96];
|
|
246
250
|
format_time(t, sizeof t, js_os_now_ms_precise() - start);
|
|
251
|
+
JSValue fmt = js_new_string_cstr(ctx, "%s: %s"); /* on the stack: the next allocation may collect */
|
|
252
|
+
JSValue elapsed = js_new_string_cstr(ctx, t);
|
|
247
253
|
JSValue *args = malloc((3 + extra) * sizeof *args);
|
|
248
254
|
if (!args) js_fatal("out of memory");
|
|
249
|
-
args[0] =
|
|
255
|
+
args[0] = fmt;
|
|
250
256
|
args[1] = label;
|
|
251
|
-
args[2] =
|
|
257
|
+
args[2] = elapsed;
|
|
252
258
|
for (uint32_t i = 0; i < extra; i++) args[3 + i] = data[i];
|
|
253
|
-
JSValue fmt = args[0], elapsed = args[2];
|
|
254
259
|
JSValue r = js_is_exception(fmt) || js_is_exception(elapsed) ? JS_EXCEPTION : print_args(ctx, 1, 3 + extra, args);
|
|
255
260
|
js_keep_alive(fmt); /* args is malloc'd: the scan doesn't see it */
|
|
256
261
|
js_keep_alive(elapsed);
|
|
@@ -329,7 +334,7 @@ NATIVE(console_time_end) {
|
|
|
329
334
|
return JS_UNDEFINED;
|
|
330
335
|
}
|
|
331
336
|
|
|
332
|
-
/* Node adds the stack's frames, which visaljs doesn't record
|
|
337
|
+
/* Node adds the stack's frames, which visaljs doesn't record. */
|
|
333
338
|
NATIVE(console_trace) {
|
|
334
339
|
UNUSED_ARGS;
|
|
335
340
|
JSValue message = js_format(ctx, argc, argv);
|
|
@@ -344,6 +349,8 @@ NATIVE(console_trace) {
|
|
|
344
349
|
|
|
345
350
|
/* ---- console.table (Node's internal/cli_table.js) --------------------------------------------- */
|
|
346
351
|
|
|
352
|
+
/* Ported from Node.js (Copyright Node.js contributors, MIT): runtime/third_party/nodejs/LICENSE. */
|
|
353
|
+
|
|
347
354
|
/* The table's strings live in malloc'd arrays: `keep`, a JS array on the stack, holds them
|
|
348
355
|
* for the scan. */
|
|
349
356
|
static JSValue kept(JSContext *ctx, JSValue keep, JSValue v) {
|
|
@@ -586,7 +593,7 @@ NATIVE(console_clear) {
|
|
|
586
593
|
JSValue js_new_console(JSContext *ctx) {
|
|
587
594
|
JSValue console = js_new_object(ctx);
|
|
588
595
|
if (js_is_exception(console)) return console;
|
|
589
|
-
/* the methods the program names (js_core.def, in Node's order
|
|
596
|
+
/* the methods the program names (js_core.def, in Node's order) */
|
|
590
597
|
js_install_core_on(ctx, JS_CORE_CONSOLE, js_as_object(console));
|
|
591
598
|
return console;
|
|
592
599
|
}
|
|
@@ -605,7 +612,7 @@ JSValue js_print(JSContext *ctx, JSValue callee, JSValue this_val,
|
|
|
605
612
|
|
|
606
613
|
void js_report_error(JSContext *ctx, const char *prefix, JSValue e) {
|
|
607
614
|
fflush(stdout);
|
|
608
|
-
/* An error prints as "Name: message" (
|
|
615
|
+
/* An error prints as "Name: message" (no frames: visaljs records none), other
|
|
609
616
|
* objects as their ToString, primitives as console.log prints them. */
|
|
610
617
|
JSValue s = js_is_error(e) ? js_error_to_string(ctx, e) : js_is_object(e) ? js_to_string(ctx, e) : js_format(ctx, 1, &e);
|
|
611
618
|
if (js_is_exception(s)) {
|
package/runtime/src/convert.c
CHANGED
|
File without changes
|
package/runtime/src/core_all.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Every core method (js_core.def), for the test hosts and --all-builtins
|
|
1
|
+
/* Every core method (js_core.def), for the test hosts and --all-builtins. Programs
|
|
2
2
|
* name theirs in their own C file, so this table is only linked when something calls
|
|
3
3
|
* js_use_all_core. */
|
|
4
4
|
#include <math.h>
|
package/runtime/src/crypto.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Web Crypto (W3C Web Cryptography API), the crypto component
|
|
1
|
+
/* Web Crypto (W3C Web Cryptography API), the crypto component, as Node has it: the
|
|
2
2
|
* `crypto` global (a Crypto: getRandomValues, randomUUID, subtle), SubtleCrypto
|
|
3
3
|
* (crypto_subtle.c) and CryptoKey (crypto_key.c). Node's errors (ERR_INVALID_THIS,
|
|
4
4
|
* ERR_MISSING_ARGS, the DOMExceptions) and its WebIDL attributes. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Asymmetric operations
|
|
1
|
+
/* Asymmetric operations on the key record: RSA signatures (PKCS#1 v1.5 and PSS
|
|
2
2
|
* encodings of our own, so any hash works and a verifier can recover a PSS salt's length, over
|
|
3
3
|
* BoringSSL's raw RSA), ECDSA (BoringSSL; DER or IEEE P1363 signatures), RSA encryption (OAEP's
|
|
4
4
|
* and PKCS#1 v1.5's paddings ours), and key agreement (EC Diffie-Hellman and X25519), with point
|
package/runtime/src/crypto_bn.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Big-integer primitives
|
|
1
|
+
/* Big-integer primitives on BoringSSL's BIGNUM: node:crypto's finite-field Diffie-Hellman
|
|
2
2
|
* (modular exponentiation), generatePrime and checkPrime. Integers travel as big-endian bytes. */
|
|
3
3
|
#include <stdlib.h>
|
|
4
4
|
#include <string.h>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* The crypto primitives' ciphers
|
|
1
|
+
/* The crypto primitives' ciphers: one streaming context for every cipher node:crypto
|
|
2
2
|
* offers (AES in ECB, CBC, CFB, CFB1, CFB8, OFB, CTR, GCM, CCM and key wrap; 2- and 3-key
|
|
3
3
|
* DES-EDE; ChaCha20 and ChaCha20-Poly1305), with OpenSSL's padding, chunking and checks. Web
|
|
4
4
|
* Crypto's AES runs on it too. BoringSSL gives the block functions (the fastest the CPU has:
|
|
@@ -636,12 +636,19 @@ int js_cipher_final(JSCipherCtx *c, JSBytesOut *out) {
|
|
|
636
636
|
return 0;
|
|
637
637
|
}
|
|
638
638
|
case JS_CIPHER_CCM:
|
|
639
|
+
/* no update (Node 24, OpenSSL 3.5): encrypting, the tag of the empty message, unless another
|
|
640
|
+
length was promised; decrypting, nothing, the tag unchecked */
|
|
639
641
|
if (c->encrypt) {
|
|
640
|
-
if (!updated)
|
|
642
|
+
if (!updated) {
|
|
643
|
+
if (c->ccm_length_set && c->ccm_length != 0) return JS_CIPHER_ERR_AUTH;
|
|
644
|
+
int e = ccm_run(c, ZEROS, 0, out);
|
|
645
|
+
if (e) return e;
|
|
646
|
+
}
|
|
641
647
|
c->tag_ready = true;
|
|
642
648
|
return 0;
|
|
643
649
|
}
|
|
644
|
-
|
|
650
|
+
if (!updated) return 0;
|
|
651
|
+
return c->auth_failed ? JS_CIPHER_ERR_AUTH : 0;
|
|
645
652
|
case JS_CIPHER_CHACHA20_POLY1305: {
|
|
646
653
|
uint8_t tag[16];
|
|
647
654
|
chapoly_tag(c, tag);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* The crypto primitives' hashes, HMAC and random bytes
|
|
1
|
+
/* The crypto primitives' hashes, HMAC and random bytes: BoringSSL's MD5, SHA-1 and
|
|
2
2
|
* SHA-2, SHA-512/224 and /256 on its SHA-512 with their own IVs, and SHA-3 and SHAKE on a
|
|
3
3
|
* Keccak-f[1600] of our own (BoringSSL has none to offer). HMAC is generic over them; random
|
|
4
4
|
* bytes are BoringSSL's. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* node:crypto's host primitives
|
|
1
|
+
/* node:crypto's host primitives: the prelude (node/prelude/crypto.js) builds Node's
|
|
2
2
|
* API on these, and Web Crypto shares the C beneath them (crypto_internal.h). Bad arguments are
|
|
3
3
|
* the prelude's to check; here they are only kept from crashing. Handles are objects of the
|
|
4
4
|
* classes below (no prototype): the prelude keeps them in its objects. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* crypto_internal.h — the crypto primitives
|
|
1
|
+
/* crypto_internal.h — the crypto primitives, runtime-private: what Web Crypto (the
|
|
2
2
|
* crypto component) and node:crypto's host primitives share. BoringSSL is reached only through
|
|
3
3
|
* the crypto*.c files, behind these. */
|
|
4
4
|
#ifndef JS_CRYPTO_INTERNAL_H
|
package/runtime/src/crypto_kdf.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* The crypto primitives' key derivation
|
|
1
|
+
/* The crypto primitives' key derivation: PBKDF2 (RFC 8018) and HKDF (RFC 5869) over
|
|
2
2
|
* crypto_hash.c's HMAC, so any of its hashes works; scrypt (RFC 7914) with its Salsa20/8 core. */
|
|
3
3
|
#include <stdlib.h>
|
|
4
4
|
#include <string.h>
|
package/runtime/src/crypto_key.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Keys
|
|
1
|
+
/* Keys: the key material, a C record both Web Crypto's CryptoKey and node:crypto's
|
|
2
2
|
* KeyObject hold (so converting between them shares it), and CryptoKey itself: Node's class,
|
|
3
3
|
* its attributes (type, extractable, algorithm, usages: the same objects on every read) and
|
|
4
4
|
* its inspection. */
|
|
@@ -76,8 +76,21 @@ JSCryptoKey *js_as_crypto_key(JSValue v) {
|
|
|
76
76
|
return js_is_object(v) && js_as_object(v)->shape->cls == &crypto_key_class ? (JSCryptoKey *)js_as_object(v) : NULL;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/* A key's usages, as Node 24 lists them: once each, in KeyUsage's order, whatever order (and
|
|
80
|
+
* repeats) they were given in */
|
|
81
|
+
static JSValue usages_of_mask(JSContext *ctx, uint16_t mask) {
|
|
82
|
+
static const char *const NAMES[] = { "encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey" };
|
|
83
|
+
JSValue a = js_new_array(ctx, 2);
|
|
84
|
+
for (int i = 0; i < 8; i++)
|
|
85
|
+
if (mask & (1u << i) && js_array_append(ctx, a, js_new_string_cstr(ctx, NAMES[i])) < 0) return JS_EXCEPTION;
|
|
86
|
+
return a;
|
|
87
|
+
}
|
|
88
|
+
|
|
79
89
|
JSValue js_new_crypto_key(JSContext *ctx, JSValue data, uint8_t alg, const JSHashAlg *hash, uint32_t length, JSValue algorithm,
|
|
80
90
|
JSValue usages, uint16_t mask, bool extractable) {
|
|
91
|
+
(void)usages;
|
|
92
|
+
usages = usages_of_mask(ctx, mask);
|
|
93
|
+
if (js_is_exception(usages)) return usages;
|
|
81
94
|
JSCryptoKey *k = (JSCryptoKey *)js_alloc_object(ctx, JS_CELL_OBJECT,
|
|
82
95
|
js_shape_root(ctx, &crypto_key_class, ctx->intrinsics[JS_INTRINSIC_CRYPTO_KEY_PROTOTYPE], 0));
|
|
83
96
|
js_init_slot(&k->data, data);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Asymmetric keys
|
|
1
|
+
/* Asymmetric keys: RSA, RSA-PSS, EC (P-256, P-384, P-521) and X25519 keys in the key
|
|
2
2
|
* record (crypto_internal.h), their DER encodings (SPKI, PKCS#8, PKCS#1, SEC1, and the public key
|
|
3
3
|
* of an X.509 certificate) with a small DER reader and writer of our own, and their generation on
|
|
4
4
|
* BoringSSL. node:crypto's KeyObject is built on the primitives at the end; Web Crypto's keys share
|