visaljs 0.0.4 → 0.0.6
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/cli.js +469 -53
- package/node/include/js_node.h +36 -0
- package/node/prelude/async_hooks.js +63 -8
- package/node/prelude/buffer.js +0 -0
- package/node/prelude/diagnostics_channel.js +322 -0
- package/node/prelude/dns.js +3 -2
- package/node/prelude/events.js +17 -3
- package/node/prelude/fs.js +177 -5
- package/node/prelude/fs_promises.js +24 -0
- package/node/prelude/http.js +13 -4
- package/node/prelude/http2.js +0 -0
- package/node/prelude/internal/async_context.js +27 -0
- package/node/prelude/internal/crypto/asym.js +0 -0
- package/node/prelude/internal/crypto/cipher.js +0 -0
- package/node/prelude/internal/crypto/kdf.js +0 -0
- package/node/prelude/internal/crypto/keys.js +0 -0
- package/node/prelude/internal/crypto/random.js +0 -0
- package/node/prelude/internal/crypto/util.js +0 -0
- package/node/prelude/internal/errors.js +11 -0
- package/node/prelude/internal/process_events.js +14 -0
- package/node/prelude/internal/process_signals.js +42 -0
- package/node/prelude/internal/querystring.js +0 -0
- package/node/prelude/internal/timers.js +233 -0
- package/node/prelude/internal/timers_global.js +9 -0
- package/node/prelude/internal/zlib_brotli.js +6 -0
- package/node/prelude/internal/zlib_engines.js +4 -0
- package/node/prelude/internal/zlib_zstd.js +6 -0
- package/node/prelude/module.js +22 -6
- package/node/prelude/net.js +9 -8
- package/node/prelude/os.js +0 -0
- package/node/prelude/path.js +1599 -186
- package/node/prelude/path_posix.js +9 -0
- package/node/prelude/path_win32.js +9 -0
- package/node/prelude/process.js +3 -0
- package/node/prelude/querystring.js +0 -0
- package/node/prelude/stream.js +18 -6
- package/node/prelude/stream_promises.js +0 -0
- package/node/prelude/stream_web.js +0 -0
- package/node/prelude/string_decoder.js +0 -0
- package/node/prelude/timers.js +92 -0
- package/node/prelude/timers_promises.js +133 -0
- package/node/prelude/tty.js +0 -0
- package/node/prelude/url.js +0 -0
- package/node/prelude/util.js +0 -0
- package/node/prelude/zlib.js +912 -72
- package/node/src/host_brotli.c +157 -0
- package/node/src/host_fs.c +95 -1
- package/node/src/host_loop.c +10 -4
- package/node/src/host_os.c +0 -0
- package/node/src/host_signal.c +70 -0
- package/node/src/host_sys.c +50 -0
- package/node/src/host_zlib.c +314 -0
- package/node/src/host_zstd.c +179 -0
- package/node/third_party/brotli/LICENSE +19 -0
- package/node/third_party/brotli/common/constants.c +15 -0
- package/node/third_party/brotli/common/constants.h +201 -0
- package/node/third_party/brotli/common/context.c +156 -0
- package/node/third_party/brotli/common/context.h +113 -0
- package/node/third_party/brotli/common/dictionary.c +5916 -0
- package/node/third_party/brotli/common/dictionary.h +64 -0
- package/node/third_party/brotli/common/platform.c +23 -0
- package/node/third_party/brotli/common/platform.h +541 -0
- package/node/third_party/brotli/common/shared_dictionary.c +521 -0
- package/node/third_party/brotli/common/shared_dictionary_internal.h +75 -0
- package/node/third_party/brotli/common/transform.c +291 -0
- package/node/third_party/brotli/common/transform.h +85 -0
- package/node/third_party/brotli/common/version.h +51 -0
- package/node/third_party/brotli/dec/bit_reader.c +78 -0
- package/node/third_party/brotli/dec/bit_reader.h +423 -0
- package/node/third_party/brotli/dec/decode.c +2875 -0
- package/node/third_party/brotli/dec/huffman.c +342 -0
- package/node/third_party/brotli/dec/huffman.h +122 -0
- package/node/third_party/brotli/dec/prefix.h +733 -0
- package/node/third_party/brotli/dec/state.c +183 -0
- package/node/third_party/brotli/dec/state.h +400 -0
- package/node/third_party/brotli/enc/backward_references.c +207 -0
- package/node/third_party/brotli/enc/backward_references.h +40 -0
- package/node/third_party/brotli/enc/backward_references_hq.c +939 -0
- package/node/third_party/brotli/enc/backward_references_hq.h +96 -0
- package/node/third_party/brotli/enc/backward_references_inc.h +189 -0
- package/node/third_party/brotli/enc/bit_cost.c +36 -0
- package/node/third_party/brotli/enc/bit_cost.h +64 -0
- package/node/third_party/brotli/enc/bit_cost_inc.h +127 -0
- package/node/third_party/brotli/enc/block_encoder_inc.h +34 -0
- package/node/third_party/brotli/enc/block_splitter.c +217 -0
- package/node/third_party/brotli/enc/block_splitter.h +52 -0
- package/node/third_party/brotli/enc/block_splitter_inc.h +481 -0
- package/node/third_party/brotli/enc/brotli_bit_stream.c +1336 -0
- package/node/third_party/brotli/enc/brotli_bit_stream.h +89 -0
- package/node/third_party/brotli/enc/cluster.c +57 -0
- package/node/third_party/brotli/enc/cluster.h +49 -0
- package/node/third_party/brotli/enc/cluster_inc.h +325 -0
- package/node/third_party/brotli/enc/command.c +28 -0
- package/node/third_party/brotli/enc/command.h +191 -0
- package/node/third_party/brotli/enc/compound_dictionary.c +207 -0
- package/node/third_party/brotli/enc/compound_dictionary.h +74 -0
- package/node/third_party/brotli/enc/compress_fragment.c +800 -0
- package/node/third_party/brotli/enc/compress_fragment.h +86 -0
- package/node/third_party/brotli/enc/compress_fragment_two_pass.c +657 -0
- package/node/third_party/brotli/enc/compress_fragment_two_pass.h +72 -0
- package/node/third_party/brotli/enc/dictionary_hash.c +1848 -0
- package/node/third_party/brotli/enc/dictionary_hash.h +25 -0
- package/node/third_party/brotli/enc/encode.c +1996 -0
- package/node/third_party/brotli/enc/encoder_dict.c +640 -0
- package/node/third_party/brotli/enc/encoder_dict.h +157 -0
- package/node/third_party/brotli/enc/entropy_encode.c +504 -0
- package/node/third_party/brotli/enc/entropy_encode.h +123 -0
- package/node/third_party/brotli/enc/entropy_encode_static.h +542 -0
- package/node/third_party/brotli/enc/fast_log.c +105 -0
- package/node/third_party/brotli/enc/fast_log.h +67 -0
- package/node/third_party/brotli/enc/find_match_length.h +72 -0
- package/node/third_party/brotli/enc/hash.h +728 -0
- package/node/third_party/brotli/enc/hash_composite_inc.h +140 -0
- package/node/third_party/brotli/enc/hash_forgetful_chain_inc.h +295 -0
- package/node/third_party/brotli/enc/hash_longest_match64_inc.h +262 -0
- package/node/third_party/brotli/enc/hash_longest_match_inc.h +258 -0
- package/node/third_party/brotli/enc/hash_longest_match_quickly_inc.h +266 -0
- package/node/third_party/brotli/enc/hash_rolling_inc.h +212 -0
- package/node/third_party/brotli/enc/hash_to_binary_tree_inc.h +330 -0
- package/node/third_party/brotli/enc/histogram.c +100 -0
- package/node/third_party/brotli/enc/histogram.h +64 -0
- package/node/third_party/brotli/enc/histogram_inc.h +51 -0
- package/node/third_party/brotli/enc/literal_cost.c +180 -0
- package/node/third_party/brotli/enc/literal_cost.h +32 -0
- package/node/third_party/brotli/enc/memory.c +194 -0
- package/node/third_party/brotli/enc/memory.h +131 -0
- package/node/third_party/brotli/enc/metablock.c +677 -0
- package/node/third_party/brotli/enc/metablock.h +106 -0
- package/node/third_party/brotli/enc/metablock_inc.h +185 -0
- package/node/third_party/brotli/enc/params.h +47 -0
- package/node/third_party/brotli/enc/prefix.h +54 -0
- package/node/third_party/brotli/enc/quality.h +202 -0
- package/node/third_party/brotli/enc/ringbuffer.h +168 -0
- package/node/third_party/brotli/enc/state.h +104 -0
- package/node/third_party/brotli/enc/static_dict.c +542 -0
- package/node/third_party/brotli/enc/static_dict.h +41 -0
- package/node/third_party/brotli/enc/static_dict_lut.h +5866 -0
- package/node/third_party/brotli/enc/utf8_util.c +85 -0
- package/node/third_party/brotli/enc/utf8_util.h +33 -0
- package/node/third_party/brotli/enc/write_bits.h +88 -0
- package/node/third_party/brotli/include/brotli/decode.h +409 -0
- package/node/third_party/brotli/include/brotli/encode.h +501 -0
- package/node/third_party/brotli/include/brotli/port.h +305 -0
- package/node/third_party/brotli/include/brotli/shared_dictionary.h +100 -0
- package/node/third_party/brotli/include/brotli/types.h +83 -0
- package/node/third_party/libuv/LICENSE +0 -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/zlib/LICENSE +19 -0
- package/node/third_party/zlib/README.chromium +38 -0
- package/node/third_party/zlib/adler32.c +197 -0
- package/node/third_party/zlib/chromeconf.h +203 -0
- package/node/third_party/zlib/contrib/optimizations/insert_string.h +80 -0
- package/node/third_party/zlib/cpu_features.c +213 -0
- package/node/third_party/zlib/cpu_features.h +22 -0
- package/node/third_party/zlib/crc32.c +1192 -0
- package/node/third_party/zlib/crc32.h +9446 -0
- package/node/third_party/zlib/deflate.c +2289 -0
- package/node/third_party/zlib/deflate.h +407 -0
- package/node/third_party/zlib/gzguts.h +214 -0
- package/node/third_party/zlib/inffast.c +327 -0
- package/node/third_party/zlib/inffast.h +26 -0
- package/node/third_party/zlib/inffixed.h +94 -0
- package/node/third_party/zlib/inflate.c +1528 -0
- package/node/third_party/zlib/inflate.h +126 -0
- package/node/third_party/zlib/inftrees.c +299 -0
- package/node/third_party/zlib/inftrees.h +62 -0
- package/node/third_party/zlib/trees.c +1161 -0
- package/node/third_party/zlib/trees.h +128 -0
- package/node/third_party/zlib/zconf.h +558 -0
- package/node/third_party/zlib/zlib.h +1967 -0
- package/node/third_party/zlib/zutil.c +299 -0
- package/node/third_party/zlib/zutil.h +275 -0
- package/node/third_party/zstd/LICENSE +30 -0
- package/node/third_party/zstd/common/allocations.h +55 -0
- package/node/third_party/zstd/common/bits.h +205 -0
- package/node/third_party/zstd/common/bitstream.h +454 -0
- package/node/third_party/zstd/common/compiler.h +464 -0
- package/node/third_party/zstd/common/cpu.h +249 -0
- package/node/third_party/zstd/common/debug.c +30 -0
- package/node/third_party/zstd/common/debug.h +107 -0
- package/node/third_party/zstd/common/entropy_common.c +340 -0
- package/node/third_party/zstd/common/error_private.c +64 -0
- package/node/third_party/zstd/common/error_private.h +158 -0
- package/node/third_party/zstd/common/fse.h +625 -0
- package/node/third_party/zstd/common/fse_decompress.c +315 -0
- package/node/third_party/zstd/common/huf.h +277 -0
- package/node/third_party/zstd/common/mem.h +422 -0
- package/node/third_party/zstd/common/pool.c +371 -0
- package/node/third_party/zstd/common/pool.h +81 -0
- package/node/third_party/zstd/common/portability_macros.h +171 -0
- package/node/third_party/zstd/common/threading.c +182 -0
- package/node/third_party/zstd/common/threading.h +142 -0
- package/node/third_party/zstd/common/xxhash.c +18 -0
- package/node/third_party/zstd/common/xxhash.h +7094 -0
- package/node/third_party/zstd/common/zstd_common.c +48 -0
- package/node/third_party/zstd/common/zstd_deps.h +123 -0
- package/node/third_party/zstd/common/zstd_internal.h +324 -0
- package/node/third_party/zstd/common/zstd_trace.h +156 -0
- package/node/third_party/zstd/compress/clevels.h +134 -0
- package/node/third_party/zstd/compress/fse_compress.c +625 -0
- package/node/third_party/zstd/compress/hist.c +191 -0
- package/node/third_party/zstd/compress/hist.h +82 -0
- package/node/third_party/zstd/compress/huf_compress.c +1464 -0
- package/node/third_party/zstd/compress/zstd_compress.c +7843 -0
- package/node/third_party/zstd/compress/zstd_compress_internal.h +1636 -0
- package/node/third_party/zstd/compress/zstd_compress_literals.c +235 -0
- package/node/third_party/zstd/compress/zstd_compress_literals.h +39 -0
- package/node/third_party/zstd/compress/zstd_compress_sequences.c +442 -0
- package/node/third_party/zstd/compress/zstd_compress_sequences.h +55 -0
- package/node/third_party/zstd/compress/zstd_compress_superblock.c +688 -0
- package/node/third_party/zstd/compress/zstd_compress_superblock.h +32 -0
- package/node/third_party/zstd/compress/zstd_cwksp.h +765 -0
- package/node/third_party/zstd/compress/zstd_double_fast.c +778 -0
- package/node/third_party/zstd/compress/zstd_double_fast.h +42 -0
- package/node/third_party/zstd/compress/zstd_fast.c +985 -0
- package/node/third_party/zstd/compress/zstd_fast.h +30 -0
- package/node/third_party/zstd/compress/zstd_lazy.c +2199 -0
- package/node/third_party/zstd/compress/zstd_lazy.h +193 -0
- package/node/third_party/zstd/compress/zstd_ldm.c +745 -0
- package/node/third_party/zstd/compress/zstd_ldm.h +109 -0
- package/node/third_party/zstd/compress/zstd_ldm_geartab.h +106 -0
- package/node/third_party/zstd/compress/zstd_opt.c +1580 -0
- package/node/third_party/zstd/compress/zstd_opt.h +72 -0
- package/node/third_party/zstd/compress/zstd_preSplit.c +238 -0
- package/node/third_party/zstd/compress/zstd_preSplit.h +33 -0
- package/node/third_party/zstd/compress/zstdmt_compress.c +1923 -0
- package/node/third_party/zstd/compress/zstdmt_compress.h +102 -0
- package/node/third_party/zstd/decompress/huf_decompress.c +1944 -0
- package/node/third_party/zstd/decompress/zstd_ddict.c +244 -0
- package/node/third_party/zstd/decompress/zstd_ddict.h +44 -0
- package/node/third_party/zstd/decompress/zstd_decompress.c +2410 -0
- package/node/third_party/zstd/decompress/zstd_decompress_block.c +2209 -0
- package/node/third_party/zstd/decompress/zstd_decompress_block.h +73 -0
- package/node/third_party/zstd/decompress/zstd_decompress_internal.h +240 -0
- package/node/third_party/zstd/zdict.h +481 -0
- package/node/third_party/zstd/zstd.h +3198 -0
- package/node/third_party/zstd/zstd_errors.h +107 -0
- package/package.json +1 -1
- package/runtime/include/js_atoms.gen.h +0 -0
- package/runtime/include/js_atoms.h +0 -0
- package/runtime/include/js_bigint.h +0 -0
- package/runtime/include/js_buffer.h +0 -0
- package/runtime/include/js_builtins.h +0 -0
- package/runtime/include/js_console.h +5 -2
- package/runtime/include/js_convert.h +0 -0
- package/runtime/include/js_core.def +0 -0
- package/runtime/include/js_error.h +0 -0
- package/runtime/include/js_exception.h +0 -0
- package/runtime/include/js_function.h +0 -0
- package/runtime/include/js_gc.h +0 -0
- package/runtime/include/js_generator.h +0 -0
- package/runtime/include/js_host.h +5 -3
- package/runtime/include/js_jobs.h +18 -1
- package/runtime/include/js_module.h +0 -0
- package/runtime/include/js_object.h +0 -0
- package/runtime/include/js_ops.h +0 -0
- package/runtime/include/js_promise.h +1 -0
- package/runtime/include/js_regexp.h +0 -0
- package/runtime/include/js_runtime.h +0 -0
- package/runtime/include/js_symbol.h +0 -0
- package/runtime/include/js_web.h +0 -0
- package/runtime/include/jscell.h +0 -0
- package/runtime/include/jscontext.h +14 -0
- package/runtime/include/jsnum.h +0 -0
- package/runtime/include/jsstring.h +0 -0
- package/runtime/include/jsvalue.h +0 -0
- package/runtime/src/arguments.c +0 -0
- package/runtime/src/array.c +0 -0
- package/runtime/src/arraybuffer.c +0 -0
- package/runtime/src/async_iter.c +0 -0
- package/runtime/src/atoms.c +0 -0
- package/runtime/src/base64.c +0 -0
- package/runtime/src/bigint.c +0 -0
- package/runtime/src/blob.c +0 -0
- package/runtime/src/buffer.c +20 -16
- package/runtime/src/builtin_table.c +0 -0
- package/runtime/src/builtins.c +0 -0
- package/runtime/src/builtins_util.h +0 -0
- package/runtime/src/collections.c +0 -0
- package/runtime/src/components.c +0 -0
- package/runtime/src/console.c +15 -2
- package/runtime/src/convert.c +0 -0
- package/runtime/src/core_all.c +0 -0
- package/runtime/src/crypto.c +0 -0
- package/runtime/src/crypto_host.c +0 -0
- package/runtime/src/crypto_kdf.c +0 -0
- package/runtime/src/crypto_key.c +0 -0
- package/runtime/src/date.c +0 -0
- package/runtime/src/domexception.c +0 -0
- package/runtime/src/elements.c +0 -0
- package/runtime/src/elements.h +0 -0
- package/runtime/src/encoding.c +0 -0
- package/runtime/src/error.c +0 -0
- package/runtime/src/events.c +1 -1
- package/runtime/src/exception.c +0 -0
- package/runtime/src/fetch.c +0 -0
- package/runtime/src/function.c +0 -0
- package/runtime/src/gc.c +2 -0
- package/runtime/src/generator.c +0 -0
- package/runtime/src/global.c +0 -0
- package/runtime/src/headers.c +0 -0
- package/runtime/src/inspect.c +0 -0
- package/runtime/src/internal.h +0 -0
- package/runtime/src/iterate.c +0 -0
- package/runtime/src/iterator.c +0 -0
- package/runtime/src/jobs.c +123 -44
- package/runtime/src/jsnum.c +0 -0
- package/runtime/src/json.c +0 -0
- package/runtime/src/math.c +0 -0
- package/runtime/src/module.c +0 -0
- package/runtime/src/number.c +0 -0
- package/runtime/src/object.c +0 -0
- package/runtime/src/ops.c +0 -0
- package/runtime/src/os.c +0 -0
- package/runtime/src/os.h +0 -0
- package/runtime/src/process.c +92 -8
- package/runtime/src/promise.c +7 -2
- package/runtime/src/proxy.c +0 -0
- package/runtime/src/reflect.c +0 -0
- package/runtime/src/regexp.c +0 -0
- package/runtime/src/regexp_anchor.h +0 -0
- package/runtime/src/regexp_message.h +0 -0
- package/runtime/src/shape.c +0 -0
- package/runtime/src/shape.h +0 -0
- package/runtime/src/streams.c +0 -0
- package/runtime/src/streams.h +0 -0
- package/runtime/src/string.c +0 -0
- package/runtime/src/string_builtins.c +0 -0
- package/runtime/src/symbol.c +0 -0
- package/runtime/src/test_host.c +0 -0
- package/runtime/src/typedarray.c +0 -0
- package/runtime/src/tznames.gen.h +0 -0
- package/runtime/src/uri.c +0 -0
- package/runtime/src/url.c +0 -0
- package/runtime/src/weak.c +1 -4
- package/runtime/src/web.c +0 -0
- package/runtime/src/wrapper.c +0 -0
- package/runtime/src/writable.c +0 -0
- package/runtime/third_party/ada-idna/LICENSE-MIT +0 -0
- package/runtime/third_party/ada-idna/README.md +0 -0
- package/runtime/third_party/ada-idna/convert.mjs +0 -0
- package/runtime/third_party/ada-idna/idna.c +0 -0
- package/runtime/third_party/ada-idna/idna.h +0 -0
- package/runtime/third_party/ada-idna/idna_tables.h +0 -0
- package/runtime/third_party/quickjs-dtoa/LICENSE +0 -0
- package/runtime/third_party/quickjs-dtoa/README.md +0 -0
- 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 +0 -0
- 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/v8-ieee754/LICENSE +0 -0
- package/runtime/third_party/v8-ieee754/README.md +0 -0
- 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 +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under both the BSD-style license (found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
7
|
+
* in the COPYING file in the root directory of this source tree).
|
|
8
|
+
* You may select, at your option, one of the above-listed licenses.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#ifndef ZSTD_ERRORS_H_398273423
|
|
12
|
+
#define ZSTD_ERRORS_H_398273423
|
|
13
|
+
|
|
14
|
+
#if defined (__cplusplus)
|
|
15
|
+
extern "C" {
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
/* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */
|
|
19
|
+
#ifndef ZSTDERRORLIB_VISIBLE
|
|
20
|
+
/* Backwards compatibility with old macro name */
|
|
21
|
+
# ifdef ZSTDERRORLIB_VISIBILITY
|
|
22
|
+
# define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY
|
|
23
|
+
# elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
|
24
|
+
# define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default")))
|
|
25
|
+
# else
|
|
26
|
+
# define ZSTDERRORLIB_VISIBLE
|
|
27
|
+
# endif
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#ifndef ZSTDERRORLIB_HIDDEN
|
|
31
|
+
# if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
|
32
|
+
# define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden")))
|
|
33
|
+
# else
|
|
34
|
+
# define ZSTDERRORLIB_HIDDEN
|
|
35
|
+
# endif
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
|
39
|
+
# define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE
|
|
40
|
+
#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
|
41
|
+
# define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
|
42
|
+
#else
|
|
43
|
+
# define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
/*-*********************************************
|
|
47
|
+
* Error codes list
|
|
48
|
+
*-*********************************************
|
|
49
|
+
* Error codes _values_ are pinned down since v1.3.1 only.
|
|
50
|
+
* Therefore, don't rely on values if you may link to any version < v1.3.1.
|
|
51
|
+
*
|
|
52
|
+
* Only values < 100 are considered stable.
|
|
53
|
+
*
|
|
54
|
+
* note 1 : this API shall be used with static linking only.
|
|
55
|
+
* dynamic linking is not yet officially supported.
|
|
56
|
+
* note 2 : Prefer relying on the enum than on its value whenever possible
|
|
57
|
+
* This is the only supported way to use the error list < v1.3.1
|
|
58
|
+
* note 3 : ZSTD_isError() is always correct, whatever the library version.
|
|
59
|
+
**********************************************/
|
|
60
|
+
typedef enum {
|
|
61
|
+
ZSTD_error_no_error = 0,
|
|
62
|
+
ZSTD_error_GENERIC = 1,
|
|
63
|
+
ZSTD_error_prefix_unknown = 10,
|
|
64
|
+
ZSTD_error_version_unsupported = 12,
|
|
65
|
+
ZSTD_error_frameParameter_unsupported = 14,
|
|
66
|
+
ZSTD_error_frameParameter_windowTooLarge = 16,
|
|
67
|
+
ZSTD_error_corruption_detected = 20,
|
|
68
|
+
ZSTD_error_checksum_wrong = 22,
|
|
69
|
+
ZSTD_error_literals_headerWrong = 24,
|
|
70
|
+
ZSTD_error_dictionary_corrupted = 30,
|
|
71
|
+
ZSTD_error_dictionary_wrong = 32,
|
|
72
|
+
ZSTD_error_dictionaryCreation_failed = 34,
|
|
73
|
+
ZSTD_error_parameter_unsupported = 40,
|
|
74
|
+
ZSTD_error_parameter_combination_unsupported = 41,
|
|
75
|
+
ZSTD_error_parameter_outOfBound = 42,
|
|
76
|
+
ZSTD_error_tableLog_tooLarge = 44,
|
|
77
|
+
ZSTD_error_maxSymbolValue_tooLarge = 46,
|
|
78
|
+
ZSTD_error_maxSymbolValue_tooSmall = 48,
|
|
79
|
+
ZSTD_error_cannotProduce_uncompressedBlock = 49,
|
|
80
|
+
ZSTD_error_stabilityCondition_notRespected = 50,
|
|
81
|
+
ZSTD_error_stage_wrong = 60,
|
|
82
|
+
ZSTD_error_init_missing = 62,
|
|
83
|
+
ZSTD_error_memory_allocation = 64,
|
|
84
|
+
ZSTD_error_workSpace_tooSmall= 66,
|
|
85
|
+
ZSTD_error_dstSize_tooSmall = 70,
|
|
86
|
+
ZSTD_error_srcSize_wrong = 72,
|
|
87
|
+
ZSTD_error_dstBuffer_null = 74,
|
|
88
|
+
ZSTD_error_noForwardProgress_destFull = 80,
|
|
89
|
+
ZSTD_error_noForwardProgress_inputEmpty = 82,
|
|
90
|
+
/* following error codes are __NOT STABLE__, they can be removed or changed in future versions */
|
|
91
|
+
ZSTD_error_frameIndex_tooLarge = 100,
|
|
92
|
+
ZSTD_error_seekableIO = 102,
|
|
93
|
+
ZSTD_error_dstBuffer_wrong = 104,
|
|
94
|
+
ZSTD_error_srcBuffer_wrong = 105,
|
|
95
|
+
ZSTD_error_sequenceProducer_failed = 106,
|
|
96
|
+
ZSTD_error_externalSequences_invalid = 107,
|
|
97
|
+
ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
|
|
98
|
+
} ZSTD_ErrorCode;
|
|
99
|
+
|
|
100
|
+
ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code); /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
#if defined (__cplusplus)
|
|
104
|
+
}
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
#endif /* ZSTD_ERRORS_H_398273423 */
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -51,9 +51,12 @@ JSValue js_new_console(JSContext *ctx);
|
|
|
51
51
|
JSValue js_print(JSContext *ctx, JSValue callee, JSValue this_val,
|
|
52
52
|
uint32_t argc, const JSValue *argv, JSValue new_target);
|
|
53
53
|
|
|
54
|
-
/*
|
|
55
|
-
*
|
|
54
|
+
/* An uncaught error, the pending exception (cleared): the host's handler's (rt->on_uncaught),
|
|
55
|
+
* else printed to stderr. 0 when handled (the program goes on), else the exit status: 1, or the
|
|
56
|
+
* handler's. js_report_rejection is the same for the reason of a promise rejected and
|
|
57
|
+
* unhandled, printed "Uncaught (in promise) …". */
|
|
56
58
|
int js_report_uncaught(JSContext *ctx);
|
|
59
|
+
int js_report_rejection(JSContext *ctx, JSValue promise, JSValue reason);
|
|
57
60
|
/* Prints `prefix` and the value as an uncaught error to stderr (e.g. "Uncaught (in promise) "). */
|
|
58
61
|
void js_report_error(JSContext *ctx, const char *prefix, JSValue e);
|
|
59
62
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/runtime/include/js_gc.h
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
#include "js_function.h"
|
|
9
9
|
|
|
10
|
-
/* process.c: console, process and global, installed before the program runs (main);
|
|
11
|
-
* the
|
|
10
|
+
/* process.c: console, process and global, installed before the program runs (main); the end
|
|
11
|
+
* of the program, after the event loop ended with `status` (0, or 1 after an uncaught error):
|
|
12
|
+
* process's 'beforeExit' (on success; it may run the loop again) and 'exit', and the exit status
|
|
13
|
+
* (process.exitCode); a process warning on stderr */
|
|
12
14
|
int js_host_init(JSContext *ctx, int argc, char **argv);
|
|
13
|
-
int
|
|
15
|
+
int js_host_exit(JSContext *ctx, int status);
|
|
14
16
|
void js_emit_warning(JSContext *ctx, JSValue message, const char *type, const char *code);
|
|
15
17
|
|
|
16
18
|
/* cwd(): the working directory (process.cwd()), also a host primitive of node:path; -errno on failure. */
|
|
@@ -23,8 +23,9 @@ enum {
|
|
|
23
23
|
/* Every queued job's values are precise GC roots. */
|
|
24
24
|
typedef struct JSJob {
|
|
25
25
|
uint8_t kind;
|
|
26
|
-
JSContext *realm;
|
|
26
|
+
JSContext *realm; /* set by js_enqueue_microtask: the realm that queued it */
|
|
27
27
|
JSValue a, b, c;
|
|
28
|
+
JSValue context; /* set by js_enqueue_microtask: the async context it runs under (ADR 0020) */
|
|
28
29
|
} JSJob;
|
|
29
30
|
|
|
30
31
|
typedef struct JSJobQueue {
|
|
@@ -42,6 +43,7 @@ typedef struct JSTimer {
|
|
|
42
43
|
JSContext *realm;
|
|
43
44
|
JSValue fn;
|
|
44
45
|
JSValue args; /* an array of the extra arguments, or undefined */
|
|
46
|
+
JSValue context; /* the async context it was set in, which it runs under (ADR 0020) */
|
|
45
47
|
} JSTimer;
|
|
46
48
|
|
|
47
49
|
typedef struct JSTimers {
|
|
@@ -76,9 +78,24 @@ void js_track_rejection(JSContext *ctx, JSValue promise, bool rejected);
|
|
|
76
78
|
/* A one-shot timer from C: fn() after `delay` ms (clamped as setTimeout clamps it). An unref'd
|
|
77
79
|
* one doesn't keep the program alive, as Node's timer.unref(). Its id (clearTimeout's). */
|
|
78
80
|
uint32_t js_add_timer(JSContext *ctx, JSValue fn, double delay, bool unref);
|
|
81
|
+
/* The timers node:timers builds its Timeout and Immediate objects on: fn() once, after `delay` ms
|
|
82
|
+
* or, `immediate`, at the loop's time (setImmediate's). A nonzero `id` restarts that timer, pending
|
|
83
|
+
* or not, under the same id (Timeout's refresh()); 0 gives a new one. Its id. */
|
|
84
|
+
uint32_t js_timer_start(JSContext *ctx, JSValue fn, double delay, bool immediate, bool unref, uint32_t id);
|
|
85
|
+
/* ref() / unref() on a pending timer: whether it keeps the program alive */
|
|
86
|
+
void js_timer_set_ref(JSContext *ctx, uint32_t id, bool ref);
|
|
87
|
+
void js_timer_clear(JSContext *ctx, uint32_t id);
|
|
88
|
+
|
|
89
|
+
/* The async context (ADR 0020): the host's value for the current chain of async work, which
|
|
90
|
+
* jobs, timers and promise reactions carry to where they run (undefined: none). Setting it
|
|
91
|
+
* isn't undone by the runtime: the caller restores the one it replaced. */
|
|
92
|
+
JSValue js_async_context(JSContext *ctx);
|
|
93
|
+
void js_set_async_context(JSContext *ctx, JSValue context);
|
|
79
94
|
|
|
80
95
|
/* Runs the program after its main script returned `main_result`: reports an uncaught
|
|
81
96
|
* error, else checkpoints until nothing is pending. The process exit status. */
|
|
82
97
|
int js_run_event_loop(JSContext *ctx, JSValue main_result);
|
|
98
|
+
/* Whether the loop has more to do: a timer not unref'd, or I/O. */
|
|
99
|
+
bool js_event_loop_alive(JSContext *ctx);
|
|
83
100
|
|
|
84
101
|
#endif /* JS_JOBS_H */
|
|
File without changes
|
|
File without changes
|
package/runtime/include/js_ops.h
CHANGED
|
File without changes
|
|
@@ -18,6 +18,7 @@ typedef struct JSPromise {
|
|
|
18
18
|
uint8_t state; /* JS_PROMISE_* */
|
|
19
19
|
uint8_t is_handled; /* [[PromiseIsHandled]]: rejection tracking */
|
|
20
20
|
uint8_t already_resolved; /* settled through the runtime (no resolving functions) */
|
|
21
|
+
uint8_t reported; /* rejected, unhandled and handled by the host (rt->on_uncaught) */
|
|
21
22
|
} JSPromise;
|
|
22
23
|
|
|
23
24
|
bool js_is_promise(JSValue v);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/runtime/include/js_web.h
CHANGED
|
File without changes
|
package/runtime/include/jscell.h
CHANGED
|
File without changes
|
|
@@ -183,7 +183,21 @@ struct JSRuntime {
|
|
|
183
183
|
uintptr_t stack_limit; /* lowest usable stack address, margin included */
|
|
184
184
|
JSJobQueue jobs; /* microtasks (ADR 0008) */
|
|
185
185
|
JSTimers timers; /* setTimeout / setInterval (ADR 0008) */
|
|
186
|
+
/* The async context (ADR 0020): an opaque value the host keeps per chain of async work
|
|
187
|
+
* (node:async_hooks' AsyncLocalStorage keeps its stores in it). Every job, timer and promise
|
|
188
|
+
* reaction takes the one current when it was queued, and runs under it. Undefined: none. A root. */
|
|
189
|
+
JSValue async_context;
|
|
186
190
|
struct JSRejections { JSValue *items; size_t count, cap; } rejections; /* rejected, unhandled promises (roots) */
|
|
191
|
+
struct JSRejections handled_late; /* reported ones given a handler since: for on_handled_late (roots) */
|
|
192
|
+
/* Set by the host (process's 'uncaughtException', 'unhandledRejection'): an uncaught error,
|
|
193
|
+
* or the reason of a promise rejected and unhandled (`promise` undefined for an error).
|
|
194
|
+
* 0 handled, -1 not (it is reported), else the exit status after the host reported its
|
|
195
|
+
* handler's own error (7 for 'uncaughtException''s, as in Node). on_handled_late: a
|
|
196
|
+
* promise it handled got a handler ('rejectionHandled'), at the end of a checkpoint; 0, or
|
|
197
|
+
* -1 after an exception. */
|
|
198
|
+
int (*on_uncaught)(JSContext *ctx, JSValue error, JSValue promise);
|
|
199
|
+
int (*on_handled_late)(JSContext *ctx, JSValue promise);
|
|
200
|
+
uint8_t failure; /* the exit status after an uncaught error: 1, or on_uncaught's */
|
|
187
201
|
struct JSWeakList { struct JSObject **items; size_t count, cap; } weak; /* WeakMap/Set/Ref, registries (ADR 0002) */
|
|
188
202
|
struct JSKeptAlive { JSValue *items; size_t count, cap; } kept_alive; /* [[KeptAlive]]: roots until ClearKeptObjects */
|
|
189
203
|
const struct JSComponent *const *components; /* installed in every realm (ADR 0014) */
|
package/runtime/include/jsnum.h
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/runtime/src/arguments.c
CHANGED
|
File without changes
|
package/runtime/src/array.c
CHANGED
|
File without changes
|
|
File without changes
|
package/runtime/src/async_iter.c
CHANGED
|
File without changes
|
package/runtime/src/atoms.c
CHANGED
|
File without changes
|
package/runtime/src/base64.c
CHANGED
|
File without changes
|
package/runtime/src/bigint.c
CHANGED
|
File without changes
|
package/runtime/src/blob.c
CHANGED
|
File without changes
|
package/runtime/src/buffer.c
CHANGED
|
@@ -1256,11 +1256,15 @@ JSValue js_new_buffer_from_bytes(JSContext *ctx, const uint8_t *p, size_t n) { r
|
|
|
1256
1256
|
|
|
1257
1257
|
/* ---- Realm ---------------------------------------------------------------------------------- */
|
|
1258
1258
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
/* Node assigns them, so they're enumerable (safer-buffer copies them with for-in) */
|
|
1259
|
+
/* Node assigns them, so they're enumerable: safer-buffer copies the statics with for-in, and
|
|
1260
|
+
* mysql2's MockBuffer stubs out the prototype's methods with for-in */
|
|
1262
1261
|
#define STATIC(name, fn, length) \
|
|
1263
1262
|
{ (name), NULL, JS_BUILTIN_KIND_FN, JS_BUILTIN_METHOD_ATTRS | JS_PROP_ENUMERABLE, (length), (fn), NULL, 0, NULL }
|
|
1263
|
+
#define FN(name, fn, length) STATIC(name, fn, length)
|
|
1264
|
+
#define ALIAS(name, earlier) \
|
|
1265
|
+
{ (name), NULL, JS_BUILTIN_KIND_ALIAS, JS_BUILTIN_METHOD_ATTRS | JS_PROP_ENUMERABLE, 0, NULL, NULL, 0, (earlier) }
|
|
1266
|
+
#define GETTER(name, get) \
|
|
1267
|
+
{ (name), NULL, JS_BUILTIN_KIND_ACCESSOR, JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE, 0, (get), NULL, 0, NULL }
|
|
1264
1268
|
|
|
1265
1269
|
static const JSBuiltin buffer_statics[] = {
|
|
1266
1270
|
JS_BUILTIN_NUMBER("poolSize", 8192, JS_PROP_DEFAULT),
|
|
@@ -1279,28 +1283,28 @@ static const JSBuiltin buffer_statics[] = {
|
|
|
1279
1283
|
|
|
1280
1284
|
static const JSBuiltin buffer_proto[] = {
|
|
1281
1285
|
FN("readBigUInt64LE", read_big_uint64le, 0), FN("readBigUInt64BE", read_big_uint64be, 0),
|
|
1282
|
-
|
|
1286
|
+
ALIAS("readBigUint64LE", "readBigUInt64LE"), ALIAS("readBigUint64BE", "readBigUInt64BE"),
|
|
1283
1287
|
FN("readBigInt64LE", read_big_int64le, 0), FN("readBigInt64BE", read_big_int64be, 0),
|
|
1284
1288
|
FN("writeBigUInt64LE", write_big_uint64le, 0), FN("writeBigUInt64BE", write_big_uint64be, 0),
|
|
1285
|
-
|
|
1289
|
+
ALIAS("writeBigUint64LE", "writeBigUInt64LE"), ALIAS("writeBigUint64BE", "writeBigUInt64BE"),
|
|
1286
1290
|
FN("writeBigInt64LE", write_big_int64le, 0), FN("writeBigInt64BE", write_big_int64be, 0),
|
|
1287
1291
|
FN("readUIntLE", read_uintle, 2), FN("readUInt32LE", read_uint32le, 0), FN("readUInt16LE", read_uint16le, 0),
|
|
1288
1292
|
FN("readUInt8", read_uint8, 0), FN("readUIntBE", read_uintbe, 2), FN("readUInt32BE", read_uint32be, 0),
|
|
1289
1293
|
FN("readUInt16BE", read_uint16be, 0),
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
+
ALIAS("readUintLE", "readUIntLE"), ALIAS("readUint32LE", "readUInt32LE"),
|
|
1295
|
+
ALIAS("readUint16LE", "readUInt16LE"), ALIAS("readUint8", "readUInt8"),
|
|
1296
|
+
ALIAS("readUintBE", "readUIntBE"), ALIAS("readUint32BE", "readUInt32BE"),
|
|
1297
|
+
ALIAS("readUint16BE", "readUInt16BE"),
|
|
1294
1298
|
FN("readIntLE", read_intle, 2), FN("readInt32LE", read_int32le, 0), FN("readInt16LE", read_int16le, 0),
|
|
1295
1299
|
FN("readInt8", read_int8, 0), FN("readIntBE", read_intbe, 2), FN("readInt32BE", read_int32be, 0),
|
|
1296
1300
|
FN("readInt16BE", read_int16be, 0),
|
|
1297
1301
|
FN("writeUIntLE", write_uintle, 3), FN("writeUInt32LE", write_uint32le, 0), FN("writeUInt16LE", write_uint16le, 0),
|
|
1298
1302
|
FN("writeUInt8", write_uint8, 0), FN("writeUIntBE", write_uintbe, 3), FN("writeUInt32BE", write_uint32be, 0),
|
|
1299
1303
|
FN("writeUInt16BE", write_uint16be, 0),
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
+
ALIAS("writeUintLE", "writeUIntLE"), ALIAS("writeUint32LE", "writeUInt32LE"),
|
|
1305
|
+
ALIAS("writeUint16LE", "writeUInt16LE"), ALIAS("writeUint8", "writeUInt8"),
|
|
1306
|
+
ALIAS("writeUintBE", "writeUIntBE"), ALIAS("writeUint32BE", "writeUInt32BE"),
|
|
1307
|
+
ALIAS("writeUint16BE", "writeUInt16BE"),
|
|
1304
1308
|
FN("writeIntLE", write_intle, 3), FN("writeInt32LE", write_int32le, 0), FN("writeInt16LE", write_int16le, 0),
|
|
1305
1309
|
FN("writeInt8", write_int8, 0), FN("writeIntBE", write_intbe, 3), FN("writeInt32BE", write_int32be, 0),
|
|
1306
1310
|
FN("writeInt16BE", write_int16be, 0),
|
|
@@ -1314,8 +1318,8 @@ static const JSBuiltin buffer_proto[] = {
|
|
|
1314
1318
|
FN("asciiWrite", buffer_ascii_write, 3), FN("base64Write", buffer_base64_write, 3),
|
|
1315
1319
|
FN("base64urlWrite", buffer_base64url_write, 3), FN("latin1Write", buffer_latin1_write, 3),
|
|
1316
1320
|
FN("hexWrite", buffer_hex_write, 3), FN("ucs2Write", buffer_ucs2_write, 3), FN("utf8Write", buffer_utf8_write, 3),
|
|
1317
|
-
|
|
1318
|
-
|
|
1321
|
+
GETTER("parent", buffer_parent),
|
|
1322
|
+
GETTER("offset", buffer_offset),
|
|
1319
1323
|
FN("copy", buffer_copy, 4),
|
|
1320
1324
|
FN("toString", buffer_to_string, 3),
|
|
1321
1325
|
FN("equals", buffer_equals, 1),
|
|
@@ -1332,7 +1336,7 @@ static const JSBuiltin buffer_proto[] = {
|
|
|
1332
1336
|
FN("swap16", buffer_swap16, 0),
|
|
1333
1337
|
FN("swap32", buffer_swap32, 0),
|
|
1334
1338
|
FN("swap64", buffer_swap64, 0),
|
|
1335
|
-
|
|
1339
|
+
ALIAS("toLocaleString", "toString"),
|
|
1336
1340
|
};
|
|
1337
1341
|
|
|
1338
1342
|
static void install_buffer(JSContext *ctx, JSObject *global) {
|
|
File without changes
|
package/runtime/src/builtins.c
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/runtime/src/components.c
CHANGED
|
File without changes
|
package/runtime/src/console.c
CHANGED
|
@@ -619,7 +619,20 @@ void js_report_error(JSContext *ctx, const char *prefix, JSValue e) {
|
|
|
619
619
|
fflush(stderr);
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
static int uncaught(JSContext *ctx, const char *prefix, JSValue error, JSValue promise) {
|
|
623
|
+
JSRuntime *rt = ctx->rt;
|
|
624
|
+
int status = rt->on_uncaught ? rt->on_uncaught(ctx, error, promise) : -1;
|
|
625
|
+
if (status < 0) {
|
|
626
|
+
js_report_error(ctx, prefix, error);
|
|
627
|
+
status = 1;
|
|
628
|
+
}
|
|
629
|
+
return status ? (rt->failure = (uint8_t)status) : 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
622
632
|
int js_report_uncaught(JSContext *ctx) {
|
|
623
|
-
|
|
624
|
-
|
|
633
|
+
return uncaught(ctx, "Uncaught ", js_take_exception(ctx), JS_UNDEFINED);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
int js_report_rejection(JSContext *ctx, JSValue promise, JSValue reason) {
|
|
637
|
+
return uncaught(ctx, "Uncaught (in promise) ", reason, promise);
|
|
625
638
|
}
|
package/runtime/src/convert.c
CHANGED
|
File without changes
|
package/runtime/src/core_all.c
CHANGED
|
File without changes
|
package/runtime/src/crypto.c
CHANGED
|
File without changes
|
|
File without changes
|
package/runtime/src/crypto_kdf.c
CHANGED
|
File without changes
|
package/runtime/src/crypto_key.c
CHANGED
|
File without changes
|
package/runtime/src/date.c
CHANGED
|
File without changes
|
|
File without changes
|
package/runtime/src/elements.c
CHANGED
|
File without changes
|
package/runtime/src/elements.h
CHANGED
|
File without changes
|
package/runtime/src/encoding.c
CHANGED
|
File without changes
|
package/runtime/src/error.c
CHANGED
|
File without changes
|
package/runtime/src/events.c
CHANGED
|
@@ -410,7 +410,7 @@ BUILTIN(rethrow) {
|
|
|
410
410
|
|
|
411
411
|
static void report_later(JSContext *ctx) {
|
|
412
412
|
JSValue error = js_take_exception(ctx);
|
|
413
|
-
JSJob job = { JS_JOB_CALLBACK, NULL, js_new_closure_native(ctx, rethrow, 0, error), JS_UNDEFINED, JS_UNDEFINED };
|
|
413
|
+
JSJob job = { JS_JOB_CALLBACK, NULL, js_new_closure_native(ctx, rethrow, 0, error), JS_UNDEFINED, JS_UNDEFINED, JS_UNDEFINED };
|
|
414
414
|
js_enqueue_microtask(ctx, &job);
|
|
415
415
|
}
|
|
416
416
|
|
package/runtime/src/exception.c
CHANGED
|
File without changes
|
package/runtime/src/fetch.c
CHANGED
|
File without changes
|
package/runtime/src/function.c
CHANGED
|
File without changes
|
package/runtime/src/gc.c
CHANGED
|
@@ -521,6 +521,7 @@ static void mark_roots(JSRuntime *rt, JSTracer *trc) {
|
|
|
521
521
|
JSHeap *h = &rt->heap;
|
|
522
522
|
js_trace_value(trc, rt->exception); /* ADR 0004, invariant 4 */
|
|
523
523
|
js_trace_value(trc, rt->symbol_registry);
|
|
524
|
+
js_trace_value(trc, rt->async_context);
|
|
524
525
|
js_jobs_trace(rt, trc); /* queued jobs, unhandled rejections (ADR 0008) */
|
|
525
526
|
js_weak_trace_roots(rt, trc); /* the WeakRef kept-alive set */
|
|
526
527
|
for (JSContext *realm = rt->realms; realm; realm = realm->next_realm)
|
|
@@ -724,6 +725,7 @@ JSRuntime *js_runtime_new(void) {
|
|
|
724
725
|
rt->stack_limit = (uintptr_t)stack_low + JS_STACK_MARGIN;
|
|
725
726
|
rt->exception = JS_EMPTY;
|
|
726
727
|
rt->symbol_registry = JS_UNDEFINED;
|
|
728
|
+
rt->async_context = JS_UNDEFINED;
|
|
727
729
|
rt->heap.min_heap = JS_GC_MIN_HEAP;
|
|
728
730
|
const char *limit = getenv("JS_HEAP_LIMIT_MB");
|
|
729
731
|
if (limit) rt->heap.heap_limit = (size_t)strtoull(limit, NULL, 10) << 20;
|
package/runtime/src/generator.c
CHANGED
|
File without changes
|
package/runtime/src/global.c
CHANGED
|
File without changes
|
package/runtime/src/headers.c
CHANGED
|
File without changes
|
package/runtime/src/inspect.c
CHANGED
|
File without changes
|
package/runtime/src/internal.h
CHANGED
|
File without changes
|
package/runtime/src/iterate.c
CHANGED
|
File without changes
|
package/runtime/src/iterator.c
CHANGED
|
File without changes
|