@encharm/cws 4.4.1 → 4.5.2
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/binding.gyp +1 -1
- package/dist/bindings/cws_darwin_arm64_node115.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node127.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node137.node +0 -0
- package/dist/bindings/cws_linux_arm64_node115.node +0 -0
- package/dist/bindings/cws_linux_arm64_node127.node +0 -0
- package/dist/bindings/cws_linux_x64_node115.node +0 -0
- package/dist/bindings/cws_linux_x64_node127.node +0 -0
- package/dist/bindings/cws_linux_x64_node137.node +0 -0
- package/dist/bindings/cws_win32_x64_node108.node +0 -0
- package/dist/bindings/cws_win32_x64_node115.node +0 -0
- package/dist/bindings/cws_win32_x64_node127.node +0 -0
- package/dist/bindings/cws_win32_x64_node83.node +0 -0
- package/dist/bindings/cws_win32_x64_node93.node +0 -0
- package/package.json +1 -1
- package/src/Addon.h +13 -23
- package/src/Socket.h +0 -1
- package/src/headers/22/acorn_version.h +6 -0
- package/src/headers/22/aliased_buffer-inl.h +243 -0
- package/src/headers/22/aliased_buffer.h +206 -0
- package/src/headers/{18 → 22}/async_wrap-inl.h +8 -6
- package/src/headers/{18 → 22}/async_wrap.h +65 -59
- package/src/headers/{18 → 22}/base_object-inl.h +57 -117
- package/src/headers/{18 → 22}/base_object.h +58 -30
- package/src/headers/22/base_object_types.h +74 -0
- package/src/headers/22/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/22/blob_serializer_deserializer.h +132 -0
- package/src/headers/{16 → 22}/callback_queue.h +1 -0
- package/src/headers/{16 → 22}/cares_wrap.h +27 -20
- package/src/headers/22/cjs_module_lexer_version.h +6 -0
- package/src/headers/22/cleanup_queue-inl.h +62 -0
- package/src/headers/22/cleanup_queue.h +85 -0
- package/src/headers/22/compile_cache.h +104 -0
- package/src/headers/{18 → 22}/crypto/crypto_clienthello.h +1 -1
- package/src/headers/{18 → 22}/crypto/crypto_context.h +31 -7
- package/src/headers/{18 → 22}/crypto/crypto_keys.h +118 -148
- package/src/headers/{18 → 22}/crypto/crypto_tls.h +20 -5
- package/src/headers/{18 → 22}/crypto/crypto_util.h +219 -263
- package/src/headers/22/crypto/ncrypto.h +752 -0
- package/src/headers/{16 → 22}/debug_utils-inl.h +15 -7
- package/src/headers/{18 → 22}/debug_utils.h +25 -19
- package/src/headers/22/encoding_binding.h +59 -0
- package/src/headers/{14 → 22}/env-inl.h +276 -409
- package/src/headers/22/env.h +1266 -0
- package/src/headers/22/env_properties.h +497 -0
- package/src/headers/{18 → 22}/handle_wrap.h +2 -0
- package/src/headers/{18 → 22}/histogram.h +88 -48
- package/src/headers/{16 → 22}/inspector_agent.h +17 -1
- package/src/headers/{16 → 22}/inspector_profiler.h +15 -13
- package/src/headers/22/js_native_api.h +619 -0
- package/src/headers/{18 → 22}/js_native_api_types.h +46 -1
- package/src/headers/22/js_native_api_v8.h +485 -0
- package/src/headers/{18 → 22}/js_native_api_v8_internals.h +6 -0
- package/src/headers/22/json_parser.h +40 -0
- package/src/headers/{16 → 22}/json_utils.h +19 -8
- package/src/headers/{18 → 22}/memory_tracker-inl.h +16 -13
- package/src/headers/{14 → 22}/memory_tracker.h +13 -8
- package/src/headers/{16 → 22}/module_wrap.h +49 -19
- package/src/headers/22/ncrypto/ncrypto.h +752 -0
- package/src/headers/{18 → 22}/node.h +465 -68
- package/src/headers/{18 → 22}/node_api.h +66 -81
- package/src/headers/{18 → 22}/node_api_internals.h +8 -4
- package/src/headers/{18 → 22}/node_api_types.h +5 -0
- package/src/headers/22/node_binding.h +154 -0
- package/src/headers/{18 → 22}/node_blob.h +46 -78
- package/src/headers/{18 → 22}/node_bob-inl.h +1 -2
- package/src/headers/{18 → 22}/node_bob.h +2 -6
- package/src/headers/{18 → 22}/node_buffer.h +1 -1
- package/src/headers/22/node_builtins.h +220 -0
- package/src/headers/{18 → 22}/node_constants.h +3 -5
- package/src/headers/22/node_context_data.h +168 -0
- package/src/headers/22/node_contextify.h +199 -0
- package/src/headers/{16 → 22}/node_crypto.h +1 -2
- package/src/headers/22/node_dotenv.h +45 -0
- package/src/headers/{18 → 22}/node_errors.h +86 -27
- package/src/headers/22/node_exit_code.h +54 -0
- package/src/headers/22/node_external_reference.h +249 -0
- package/src/headers/{18 → 22}/node_file-inl.h +127 -30
- package/src/headers/{16 → 22}/node_file.h +122 -11
- package/src/headers/{18 → 22}/node_http2.h +28 -11
- package/src/headers/{16 → 22}/node_http2_state.h +34 -25
- package/src/headers/{18 → 22}/node_http_common-inl.h +2 -1
- package/src/headers/{18 → 22}/node_http_common.h +56 -55
- package/src/headers/{16 → 22}/node_i18n.h +5 -18
- package/src/headers/{18 → 22}/node_internals.h +121 -59
- package/src/headers/{18 → 22}/node_main_instance.h +4 -31
- package/src/headers/{18 → 22}/node_messaging.h +27 -10
- package/src/headers/{18 → 22}/node_metadata.h +23 -1
- package/src/headers/{18 → 22}/node_options-inl.h +24 -11
- package/src/headers/{18 → 22}/node_options.h +124 -39
- package/src/headers/{18 → 22}/node_perf.h +0 -2
- package/src/headers/{18 → 22}/node_perf_common.h +20 -9
- package/src/headers/{18 → 22}/node_platform.h +11 -5
- package/src/headers/{18 → 22}/node_process.h +26 -14
- package/src/headers/22/node_realm-inl.h +145 -0
- package/src/headers/22/node_realm.h +184 -0
- package/src/headers/{16 → 22}/node_report.h +13 -17
- package/src/headers/{16 → 22}/node_revert.h +3 -3
- package/src/headers/{16 → 22}/node_root_certs.h +902 -461
- package/src/headers/22/node_sea.h +64 -0
- package/src/headers/22/node_shadow_realm.h +46 -0
- package/src/headers/22/node_snapshot_builder.h +57 -0
- package/src/headers/22/node_snapshotable.h +174 -0
- package/src/headers/{18 → 22}/node_sockaddr.h +2 -2
- package/src/headers/{16 → 22}/node_stat_watcher.h +2 -1
- package/src/headers/22/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/22/node_threadsafe_cow.h +105 -0
- package/src/headers/22/node_union_bytes.h +81 -0
- package/src/headers/22/node_url.h +96 -0
- package/src/headers/22/node_v8.h +77 -0
- package/src/headers/{14 → 22}/node_v8_platform-inl.h +17 -6
- package/src/headers/{16 → 22}/node_version.h +21 -9
- package/src/headers/22/node_wasi.h +185 -0
- package/src/headers/{14 → 22}/node_watchdog.h +2 -0
- package/src/headers/{18 → 22}/node_worker.h +7 -2
- package/src/headers/22/permission/child_process_permission.h +31 -0
- package/src/headers/22/permission/fs_permission.h +167 -0
- package/src/headers/22/permission/inspector_permission.h +31 -0
- package/src/headers/22/permission/permission.h +99 -0
- package/src/headers/22/permission/permission_base.h +60 -0
- package/src/headers/22/permission/wasi_permission.h +31 -0
- package/src/headers/22/permission/worker_permission.h +31 -0
- package/src/headers/{16 → 22}/req_wrap-inl.h +7 -6
- package/src/headers/{14 → 22}/spawn_sync.h +3 -3
- package/src/headers/{18 → 22}/stream_base-inl.h +0 -135
- package/src/headers/{18 → 22}/stream_base.h +35 -16
- package/src/headers/{18 → 22}/stream_pipe.h +3 -4
- package/src/headers/{16 → 22}/stream_wrap.h +2 -1
- package/src/headers/{18 → 22}/string_bytes.h +5 -14
- package/src/headers/{14 → 22}/string_decoder-inl.h +0 -6
- package/src/headers/{16 → 22}/string_decoder.h +0 -1
- package/src/headers/{18 → 22}/tcp_wrap.h +1 -1
- package/src/headers/{18 → 22}/threadpoolwork-inl.h +14 -1
- package/src/headers/22/timers.h +76 -0
- package/src/headers/{18 → 22}/tracing/trace_event.h +7 -5
- package/src/headers/{16 → 22}/udp_wrap.h +8 -5
- package/src/headers/22/undici_version.h +6 -0
- package/src/headers/{18 → 22}/util-inl.h +97 -127
- package/src/headers/{18 → 22}/util.h +293 -106
- package/src/headers/{18 → 22}/v8-fast-api-calls.h +103 -58
- package/src/headers/24/acorn_version.h +6 -0
- package/src/headers/24/addon_permission.h +31 -0
- package/src/headers/{16/tracing → 24}/agent.h +1 -1
- package/src/headers/24/aliased_buffer-inl.h +244 -0
- package/src/headers/24/aliased_buffer.h +206 -0
- package/src/headers/24/amaro_version.h +6 -0
- package/src/headers/24/application.h +165 -0
- package/src/headers/24/async_context_frame.h +33 -0
- package/src/headers/{14 → 24}/async_wrap-inl.h +8 -6
- package/src/headers/{16 → 24}/async_wrap.h +86 -88
- package/src/headers/{16 → 24}/base_object-inl.h +75 -119
- package/src/headers/{16 → 24}/base_object.h +84 -40
- package/src/headers/24/base_object_types.h +74 -0
- package/src/headers/24/bindingdata.h +272 -0
- package/src/headers/24/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/24/blob_serializer_deserializer.h +132 -0
- package/src/headers/{18 → 24}/callback_queue.h +1 -0
- package/src/headers/{18 → 24}/cares_wrap.h +68 -144
- package/src/headers/24/child_process_permission.h +31 -0
- package/src/headers/24/cid.h +127 -0
- package/src/headers/24/cjs_module_lexer_version.h +6 -0
- package/src/headers/24/cleanup_queue-inl.h +36 -0
- package/src/headers/24/cleanup_queue.h +79 -0
- package/src/headers/24/compile_cache.h +113 -0
- package/src/headers/24/cppgc_helpers-inl.h +65 -0
- package/src/headers/24/cppgc_helpers.h +162 -0
- package/src/headers/24/crypto/crypto_aes.h +97 -0
- package/src/headers/24/crypto/crypto_argon2.h +86 -0
- package/src/headers/{16 → 24}/crypto/crypto_bio.h +8 -9
- package/src/headers/24/crypto/crypto_chacha20_poly1305.h +64 -0
- package/src/headers/{18 → 24}/crypto/crypto_cipher.h +48 -58
- package/src/headers/{16 → 24}/crypto/crypto_clienthello-inl.h +2 -2
- package/src/headers/{16 → 24}/crypto/crypto_clienthello.h +1 -1
- package/src/headers/24/crypto/crypto_common.h +48 -0
- package/src/headers/{16 → 24}/crypto/crypto_context.h +46 -22
- package/src/headers/{18 → 24}/crypto/crypto_dh.h +27 -57
- package/src/headers/{18 → 24}/crypto/crypto_dsa.h +7 -34
- package/src/headers/{18 → 24}/crypto/crypto_ec.h +42 -49
- package/src/headers/{18 → 24}/crypto/crypto_hash.h +11 -11
- package/src/headers/{18 → 24}/crypto/crypto_hkdf.h +10 -14
- package/src/headers/{18 → 24}/crypto/crypto_hmac.h +11 -13
- package/src/headers/24/crypto/crypto_kem.h +113 -0
- package/src/headers/{18 → 24}/crypto/crypto_keygen.h +59 -74
- package/src/headers/{16 → 24}/crypto/crypto_keys.h +134 -154
- package/src/headers/24/crypto/crypto_ml_dsa.h +21 -0
- package/src/headers/{18 → 24}/crypto/crypto_pbkdf2.h +9 -11
- package/src/headers/{18 → 24}/crypto/crypto_random.h +28 -34
- package/src/headers/{18 → 24}/crypto/crypto_rsa.h +30 -35
- package/src/headers/{18 → 24}/crypto/crypto_scrypt.h +8 -10
- package/src/headers/{18 → 24}/crypto/crypto_sig.h +36 -48
- package/src/headers/{16 → 24}/crypto/crypto_tls.h +35 -18
- package/src/headers/{16 → 24}/crypto/crypto_util.h +183 -321
- package/src/headers/24/crypto/crypto_x509.h +140 -0
- package/src/headers/24/data.h +148 -0
- package/src/headers/{14 → 24}/debug_utils-inl.h +17 -8
- package/src/headers/{16 → 24}/debug_utils.h +31 -22
- package/src/headers/24/defs.h +254 -0
- package/src/headers/24/embedded_data.h +17 -0
- package/src/headers/24/encoding_binding.h +60 -0
- package/src/headers/24/endpoint.h +421 -0
- package/src/headers/{16 → 24}/env-inl.h +198 -540
- package/src/headers/24/env.h +1257 -0
- package/src/headers/24/env_properties.h +561 -0
- package/src/headers/24/fs_permission.h +167 -0
- package/src/headers/{16 → 24}/handle_wrap.h +4 -2
- package/src/headers/{16 → 24}/histogram-inl.h +34 -15
- package/src/headers/24/histogram.h +279 -0
- package/src/headers/24/http3.h +44 -0
- package/src/headers/{18 → 24}/inspector_agent.h +23 -2
- package/src/headers/24/inspector_permission.h +31 -0
- package/src/headers/{18 → 24}/inspector_profiler.h +15 -15
- package/src/headers/24/io_agent.h +30 -0
- package/src/headers/{18 → 24}/js_native_api.h +74 -30
- package/src/headers/{16 → 24}/js_native_api_types.h +61 -10
- package/src/headers/{18 → 24}/js_native_api_v8.h +205 -160
- package/src/headers/{16 → 24}/js_native_api_v8_internals.h +12 -6
- package/src/headers/24/json_parser.h +40 -0
- package/src/headers/{18 → 24}/json_utils.h +19 -8
- package/src/headers/24/logstream.h +81 -0
- package/src/headers/24/main_thread_interface.h +116 -0
- package/src/headers/{16 → 24}/memory_tracker-inl.h +115 -17
- package/src/headers/{16 → 24}/memory_tracker.h +58 -9
- package/src/headers/24/module_wrap.h +229 -0
- package/src/headers/24/ncrypto.h +1625 -0
- package/src/headers/24/network_agent.h +118 -0
- package/src/headers/24/network_inspector.h +45 -0
- package/src/headers/24/network_resource_manager.h +29 -0
- package/src/headers/{16 → 24}/node.h +560 -72
- package/src/headers/24/node_api.h +269 -0
- package/src/headers/24/node_api_internals.h +46 -0
- package/src/headers/{16 → 24}/node_api_types.h +13 -11
- package/src/headers/24/node_binding.h +163 -0
- package/src/headers/{16 → 24}/node_blob.h +46 -78
- package/src/headers/{16 → 24}/node_bob-inl.h +1 -2
- package/src/headers/{16 → 24}/node_bob.h +2 -6
- package/src/headers/{14 → 24}/node_buffer.h +1 -1
- package/src/headers/24/node_builtins.h +223 -0
- package/src/headers/24/node_config_file.h +65 -0
- package/src/headers/{14 → 24}/node_constants.h +3 -5
- package/src/headers/24/node_context_data.h +168 -0
- package/src/headers/24/node_contextify.h +261 -0
- package/src/headers/{18 → 24}/node_crypto.h +7 -2
- package/src/headers/24/node_debug.h +25 -0
- package/src/headers/24/node_dotenv.h +45 -0
- package/src/headers/{16 → 24}/node_errors.h +146 -32
- package/src/headers/24/node_exit_code.h +54 -0
- package/src/headers/{18 → 24}/node_external_reference.h +44 -22
- package/src/headers/{16 → 24}/node_file-inl.h +156 -50
- package/src/headers/{18 → 24}/node_file.h +129 -15
- package/src/headers/{16 → 24}/node_http2.h +53 -18
- package/src/headers/{14 → 24}/node_http2_state.h +35 -25
- package/src/headers/{16 → 24}/node_http_common-inl.h +8 -10
- package/src/headers/{16 → 24}/node_http_common.h +63 -59
- package/src/headers/{18 → 24}/node_i18n.h +5 -18
- package/src/headers/{16 → 24}/node_internals.h +131 -76
- package/src/headers/24/node_json.h +24 -0
- package/src/headers/24/node_large_page.h +34 -0
- package/src/headers/24/node_locks.h +180 -0
- package/src/headers/{14 → 24}/node_main_instance.h +15 -44
- package/src/headers/{16 → 24}/node_mem-inl.h +7 -7
- package/src/headers/{16 → 24}/node_messaging.h +27 -11
- package/src/headers/{16 → 24}/node_metadata.h +44 -2
- package/src/headers/24/node_modules.h +93 -0
- package/src/headers/{16 → 24}/node_options-inl.h +93 -46
- package/src/headers/{16 → 24}/node_options.h +251 -63
- package/src/headers/{16 → 24}/node_perf.h +6 -25
- package/src/headers/{16 → 24}/node_perf_common.h +23 -10
- package/src/headers/24/node_platform.h +286 -0
- package/src/headers/24/node_process.h +111 -0
- package/src/headers/24/node_realm-inl.h +153 -0
- package/src/headers/24/node_realm.h +236 -0
- package/src/headers/{18 → 24}/node_report.h +13 -17
- package/src/headers/{18 → 24}/node_revert.h +3 -3
- package/src/headers/{18 → 24}/node_root_certs.h +1010 -710
- package/src/headers/24/node_sea.h +74 -0
- package/src/headers/24/node_shadow_realm.h +46 -0
- package/src/headers/24/node_snapshot_builder.h +57 -0
- package/src/headers/24/node_snapshotable.h +174 -0
- package/src/headers/{16 → 24}/node_sockaddr-inl.h +11 -20
- package/src/headers/{16 → 24}/node_sockaddr.h +9 -20
- package/src/headers/24/node_sqlite.h +270 -0
- package/src/headers/{18 → 24}/node_stat_watcher.h +2 -1
- package/src/headers/24/node_string.h +101 -0
- package/src/headers/24/node_task_runner.h +92 -0
- package/src/headers/24/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/24/node_threadsafe_cow.h +105 -0
- package/src/headers/24/node_union_bytes.h +81 -0
- package/src/headers/24/node_url.h +101 -0
- package/src/headers/24/node_url_pattern.h +118 -0
- package/src/headers/24/node_v8.h +77 -0
- package/src/headers/{18 → 24}/node_v8_platform-inl.h +22 -31
- package/src/headers/{18 → 24}/node_version.h +18 -6
- package/src/headers/24/node_wasi.h +185 -0
- package/src/headers/24/node_wasm_web_api.h +55 -0
- package/src/headers/{18 → 24}/node_watchdog.h +2 -0
- package/src/headers/24/node_webstorage.h +60 -0
- package/src/headers/{16 → 24}/node_worker.h +24 -10
- package/src/headers/24/packet.h +155 -0
- package/src/headers/24/path.h +33 -0
- package/src/headers/24/permission/addon_permission.h +31 -0
- package/src/headers/24/permission/child_process_permission.h +31 -0
- package/src/headers/24/permission/fs_permission.h +167 -0
- package/src/headers/24/permission/inspector_permission.h +31 -0
- package/src/headers/24/permission/permission.h +100 -0
- package/src/headers/24/permission/permission_base.h +65 -0
- package/src/headers/24/permission/wasi_permission.h +31 -0
- package/src/headers/24/permission/worker_permission.h +31 -0
- package/src/headers/24/permission.h +100 -0
- package/src/headers/24/permission_base.h +65 -0
- package/src/headers/24/preferredaddress.h +72 -0
- package/src/headers/24/protocol_helper.h +27 -0
- package/src/headers/24/queue.h +306 -0
- package/src/headers/{18 → 24}/req_wrap-inl.h +12 -6
- package/src/headers/{16 → 24}/req_wrap.h +3 -1
- package/src/headers/24/runtime_agent.h +41 -0
- package/src/headers/24/session.h +528 -0
- package/src/headers/24/sessionticket.h +108 -0
- package/src/headers/{18 → 24}/spawn_sync.h +9 -8
- package/src/headers/{16 → 24}/stream_base-inl.h +3 -133
- package/src/headers/{16 → 24}/stream_base.h +43 -19
- package/src/headers/{16 → 24}/stream_pipe.h +7 -4
- package/src/headers/{18 → 24}/stream_wrap.h +2 -3
- package/src/headers/24/streams.h +370 -0
- package/src/headers/{16 → 24}/string_bytes.h +8 -21
- package/src/headers/{18 → 24}/string_decoder-inl.h +0 -6
- package/src/headers/{18 → 24}/string_decoder.h +0 -1
- package/src/headers/24/target_agent.h +75 -0
- package/src/headers/{16 → 24}/tcp_wrap.h +3 -1
- package/src/headers/{14 → 24}/threadpoolwork-inl.h +14 -1
- package/src/headers/24/timer_wrap-inl.h +32 -0
- package/src/headers/{16 → 24}/timer_wrap.h +7 -4
- package/src/headers/24/timers.h +75 -0
- package/src/headers/24/tlscontext.h +228 -0
- package/src/headers/24/tokens.h +256 -0
- package/src/headers/{14/tracing → 24}/trace_event.h +7 -5
- package/src/headers/24/traced_value.h +129 -0
- package/src/headers/24/tracing_agent.h +43 -0
- package/src/headers/24/transportparams.h +166 -0
- package/src/headers/{16 → 24}/tty_wrap.h +0 -1
- package/src/headers/{18 → 24}/udp_wrap.h +8 -5
- package/src/headers/24/undici_version.h +6 -0
- package/src/headers/{16 → 24}/util-inl.h +267 -131
- package/src/headers/{16 → 24}/util.h +338 -146
- package/src/headers/24/v8-external-memory-accounter.h +60 -0
- package/src/headers/24/v8-fast-api-calls.h +819 -0
- package/src/headers/24/v8-inspector.h +426 -0
- package/src/headers/24/wasi_permission.h +31 -0
- package/src/headers/24/worker_agent.h +40 -0
- package/src/headers/24/worker_inspector.h +124 -0
- package/src/headers/24/worker_permission.h +31 -0
- package/src/headers/24/zlib_version.h +6 -0
- package/dist/bindings/cws_darwin_arm64_node83.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node93.node +0 -0
- package/dist/bindings/cws_darwin_x64_node83.node +0 -0
- package/dist/bindings/cws_darwin_x64_node93.node +0 -0
- package/dist/bindings/cws_linux_arm64_node83.node +0 -0
- package/dist/bindings/cws_linux_arm64_node93.node +0 -0
- package/dist/bindings/cws_linux_x64_node83.node +0 -0
- package/dist/bindings/cws_linux_x64_node93.node +0 -0
- package/src/headers/14/aliased_buffer.h +0 -263
- package/src/headers/14/allocated_buffer-inl.h +0 -110
- package/src/headers/14/allocated_buffer.h +0 -73
- package/src/headers/14/async_wrap.h +0 -230
- package/src/headers/14/base64.h +0 -183
- package/src/headers/14/base_object-inl.h +0 -371
- package/src/headers/14/base_object.h +0 -281
- package/src/headers/14/callback_queue-inl.h +0 -97
- package/src/headers/14/callback_queue.h +0 -78
- package/src/headers/14/debug_utils.h +0 -181
- package/src/headers/14/env.h +0 -1388
- package/src/headers/14/handle_wrap.h +0 -117
- package/src/headers/14/histogram-inl.h +0 -83
- package/src/headers/14/histogram.h +0 -98
- package/src/headers/14/inspector_agent.h +0 -149
- package/src/headers/14/inspector_profiler.h +0 -137
- package/src/headers/14/js_native_api.h +0 -544
- package/src/headers/14/js_native_api_types.h +0 -143
- package/src/headers/14/js_native_api_v8.h +0 -301
- package/src/headers/14/js_native_api_v8_internals.h +0 -38
- package/src/headers/14/json_utils.h +0 -161
- package/src/headers/14/memory_tracker-inl.h +0 -355
- package/src/headers/14/module_wrap.h +0 -99
- package/src/headers/14/node.h +0 -1032
- package/src/headers/14/node_api.h +0 -255
- package/src/headers/14/node_api_types.h +0 -44
- package/src/headers/14/node_binding.h +0 -99
- package/src/headers/14/node_context_data.h +0 -44
- package/src/headers/14/node_contextify.h +0 -161
- package/src/headers/14/node_crypto.h +0 -865
- package/src/headers/14/node_crypto_bio.h +0 -195
- package/src/headers/14/node_crypto_clienthello-inl.h +0 -91
- package/src/headers/14/node_crypto_clienthello.h +0 -132
- package/src/headers/14/node_crypto_common.h +0 -138
- package/src/headers/14/node_crypto_groups.h +0 -415
- package/src/headers/14/node_dtrace.h +0 -86
- package/src/headers/14/node_errors.h +0 -214
- package/src/headers/14/node_file-inl.h +0 -306
- package/src/headers/14/node_file.h +0 -417
- package/src/headers/14/node_http2.h +0 -1191
- package/src/headers/14/node_http_common-inl.h +0 -194
- package/src/headers/14/node_http_common.h +0 -529
- package/src/headers/14/node_i18n.h +0 -144
- package/src/headers/14/node_internals.h +0 -405
- package/src/headers/14/node_mem.h +0 -45
- package/src/headers/14/node_messaging.h +0 -303
- package/src/headers/14/node_metadata.h +0 -109
- package/src/headers/14/node_mutex.h +0 -247
- package/src/headers/14/node_native_module.h +0 -101
- package/src/headers/14/node_native_module_env.h +0 -66
- package/src/headers/14/node_options-inl.h +0 -451
- package/src/headers/14/node_options.h +0 -481
- package/src/headers/14/node_perf.h +0 -181
- package/src/headers/14/node_perf_common.h +0 -97
- package/src/headers/14/node_platform.h +0 -189
- package/src/headers/14/node_process.h +0 -40
- package/src/headers/14/node_report.h +0 -47
- package/src/headers/14/node_revert.h +0 -72
- package/src/headers/14/node_root_certs.h +0 -3458
- package/src/headers/14/node_sockaddr-inl.h +0 -170
- package/src/headers/14/node_sockaddr.h +0 -123
- package/src/headers/14/node_stat_watcher.h +0 -70
- package/src/headers/14/node_union_bytes.h +0 -103
- package/src/headers/14/node_url.h +0 -188
- package/src/headers/14/node_version.h +0 -98
- package/src/headers/14/node_wasi.h +0 -108
- package/src/headers/14/node_win32_etw_provider-inl.h +0 -287
- package/src/headers/14/node_win32_etw_provider.h +0 -99
- package/src/headers/14/node_worker.h +0 -141
- package/src/headers/14/pipe_wrap.h +0 -78
- package/src/headers/14/req_wrap-inl.h +0 -170
- package/src/headers/14/req_wrap.h +0 -77
- package/src/headers/14/stream_base-inl.h +0 -275
- package/src/headers/14/stream_base.h +0 -434
- package/src/headers/14/stream_pipe.h +0 -73
- package/src/headers/14/stream_wrap.h +0 -130
- package/src/headers/14/string_bytes.h +0 -129
- package/src/headers/14/string_decoder.h +0 -50
- package/src/headers/14/string_search.h +0 -638
- package/src/headers/14/tcp_wrap.h +0 -101
- package/src/headers/14/tls_wrap.h +0 -222
- package/src/headers/14/tracing/agent.h +0 -195
- package/src/headers/14/tracing/traced_value.h +0 -70
- package/src/headers/14/tty_wrap.h +0 -64
- package/src/headers/14/udp_wrap.h +0 -227
- package/src/headers/14/util-inl.h +0 -566
- package/src/headers/14/util.h +0 -804
- package/src/headers/14/v8abbr.h +0 -124
- package/src/headers/16/aliased_buffer.h +0 -315
- package/src/headers/16/allocated_buffer-inl.h +0 -110
- package/src/headers/16/allocated_buffer.h +0 -73
- package/src/headers/16/async_wrap-inl.h +0 -94
- package/src/headers/16/base64-inl.h +0 -189
- package/src/headers/16/base64.h +0 -69
- package/src/headers/16/crypto/crypto_aes.h +0 -89
- package/src/headers/16/crypto/crypto_cipher.h +0 -286
- package/src/headers/16/crypto/crypto_common.h +0 -187
- package/src/headers/16/crypto/crypto_dh.h +0 -157
- package/src/headers/16/crypto/crypto_dsa.h +0 -76
- package/src/headers/16/crypto/crypto_ec.h +0 -169
- package/src/headers/16/crypto/crypto_groups.h +0 -415
- package/src/headers/16/crypto/crypto_hash.h +0 -89
- package/src/headers/16/crypto/crypto_hkdf.h +0 -66
- package/src/headers/16/crypto/crypto_hmac.h +0 -94
- package/src/headers/16/crypto/crypto_keygen.h +0 -301
- package/src/headers/16/crypto/crypto_pbkdf2.h +0 -76
- package/src/headers/16/crypto/crypto_random.h +0 -130
- package/src/headers/16/crypto/crypto_rsa.h +0 -141
- package/src/headers/16/crypto/crypto_scrypt.h +0 -87
- package/src/headers/16/crypto/crypto_sig.h +0 -167
- package/src/headers/16/crypto/crypto_spkac.h +0 -20
- package/src/headers/16/crypto/crypto_timing.h +0 -20
- package/src/headers/16/crypto/crypto_x509.h +0 -141
- package/src/headers/16/env.h +0 -1629
- package/src/headers/16/histogram.h +0 -216
- package/src/headers/16/js_native_api.h +0 -561
- package/src/headers/16/js_native_api_v8.h +0 -451
- package/src/headers/16/node.d +0 -315
- package/src/headers/16/node.stp +0 -146
- package/src/headers/16/node_api.h +0 -275
- package/src/headers/16/node_api_internals.h +0 -30
- package/src/headers/16/node_binding.h +0 -99
- package/src/headers/16/node_buffer.h +0 -92
- package/src/headers/16/node_constants.h +0 -84
- package/src/headers/16/node_context_data.h +0 -44
- package/src/headers/16/node_contextify.h +0 -196
- package/src/headers/16/node_dtrace.h +0 -86
- package/src/headers/16/node_external_reference.h +0 -129
- package/src/headers/16/node_main_instance.h +0 -103
- package/src/headers/16/node_native_module.h +0 -101
- package/src/headers/16/node_native_module_env.h +0 -68
- package/src/headers/16/node_platform.h +0 -192
- package/src/headers/16/node_process.h +0 -43
- package/src/headers/16/node_provider.d +0 -80
- package/src/headers/16/node_snapshotable.h +0 -137
- package/src/headers/16/node_union_bytes.h +0 -103
- package/src/headers/16/node_url.h +0 -205
- package/src/headers/16/node_v8.h +0 -41
- package/src/headers/16/node_v8_platform-inl.h +0 -194
- package/src/headers/16/node_wasi.h +0 -108
- package/src/headers/16/node_watchdog.h +0 -152
- package/src/headers/16/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/16/node_win32_etw_provider.h +0 -99
- package/src/headers/16/spawn_sync.h +0 -242
- package/src/headers/16/string_decoder-inl.h +0 -37
- package/src/headers/16/string_search.h +0 -638
- package/src/headers/16/threadpoolwork-inl.h +0 -57
- package/src/headers/16/tracing/node_trace_buffer.h +0 -83
- package/src/headers/16/tracing/node_trace_writer.h +0 -75
- package/src/headers/16/tracing/trace_event.h +0 -720
- package/src/headers/16/tracing/traced_value.h +0 -70
- package/src/headers/16/v8abbr.h +0 -123
- package/src/headers/16/v8ustack.d +0 -695
- package/src/headers/18/aliased_buffer.h +0 -315
- package/src/headers/18/aliased_struct-inl.h +0 -54
- package/src/headers/18/aliased_struct.h +0 -63
- package/src/headers/18/base64-inl.h +0 -189
- package/src/headers/18/base64.h +0 -69
- package/src/headers/18/connect_wrap.h +0 -26
- package/src/headers/18/connection_wrap.h +0 -30
- package/src/headers/18/crypto/crypto_aes.h +0 -89
- package/src/headers/18/crypto/crypto_bio.h +0 -194
- package/src/headers/18/crypto/crypto_clienthello-inl.h +0 -90
- package/src/headers/18/crypto/crypto_common.h +0 -151
- package/src/headers/18/crypto/crypto_groups.h +0 -415
- package/src/headers/18/crypto/crypto_x509.h +0 -143
- package/src/headers/18/debug_utils-inl.h +0 -223
- package/src/headers/18/diagnosticfilename-inl.h +0 -33
- package/src/headers/18/env-inl.h +0 -1308
- package/src/headers/18/env.h +0 -1667
- package/src/headers/18/inspector_io.h +0 -78
- package/src/headers/18/inspector_socket.h +0 -60
- package/src/headers/18/inspector_socket_server.h +0 -110
- package/src/headers/18/js_stream.h +0 -52
- package/src/headers/18/memory_tracker.h +0 -284
- package/src/headers/18/module_wrap.h +0 -116
- package/src/headers/18/node_binding.h +0 -99
- package/src/headers/18/node_context_data.h +0 -44
- package/src/headers/18/node_contextify.h +0 -196
- package/src/headers/18/node_dir.h +0 -52
- package/src/headers/18/node_dtrace.h +0 -86
- package/src/headers/18/node_http2_state.h +0 -149
- package/src/headers/18/node_mem-inl.h +0 -112
- package/src/headers/18/node_native_module.h +0 -109
- package/src/headers/18/node_native_module_env.h +0 -71
- package/src/headers/18/node_object_wrap.h +0 -132
- package/src/headers/18/node_snapshot_builder.h +0 -43
- package/src/headers/18/node_snapshotable.h +0 -130
- package/src/headers/18/node_union_bytes.h +0 -103
- package/src/headers/18/node_url.h +0 -205
- package/src/headers/18/node_v8.h +0 -41
- package/src/headers/18/node_wasi.h +0 -108
- package/src/headers/18/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/18/node_win32_etw_provider.h +0 -99
- package/src/headers/18/string_search.h +0 -638
- package/src/headers/18/tracing/node_trace_buffer.h +0 -83
- package/src/headers/18/tracing/node_trace_writer.h +0 -75
- package/src/headers/18/tracing/trace_event_common.h +0 -1109
- package/src/headers/18/tracing/traced_value.h +0 -70
- package/src/headers/18/v8abbr.h +0 -123
- /package/src/headers/{14 → 22}/aliased_struct-inl.h +0 -0
- /package/src/headers/{14 → 22}/aliased_struct.h +0 -0
- /package/src/headers/{16 → 22}/callback_queue-inl.h +0 -0
- /package/src/headers/{14 → 22}/connect_wrap.h +0 -0
- /package/src/headers/{14 → 22}/connection_wrap.h +0 -0
- /package/src/headers/{14 → 22}/diagnosticfilename-inl.h +0 -0
- /package/src/headers/{18 → 22}/histogram-inl.h +0 -0
- /package/src/headers/{14 → 22}/inspector_io.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket_server.h +0 -0
- /package/src/headers/{14 → 22}/js_stream.h +0 -0
- /package/src/headers/{14 → 22}/node_dir.h +0 -0
- /package/src/headers/{14 → 22}/node_mem-inl.h +0 -0
- /package/src/headers/{16 → 22}/node_mem.h +0 -0
- /package/src/headers/{16 → 22}/node_mutex.h +0 -0
- /package/src/headers/{14 → 22}/node_object_wrap.h +0 -0
- /package/src/headers/{16 → 22}/node_process-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_sockaddr-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_wasm_web_api.h +0 -0
- /package/src/headers/{16 → 22}/pipe_wrap.h +0 -0
- /package/src/headers/{18 → 22}/req_wrap.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap-inl.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap.h +0 -0
- /package/src/headers/{18 → 22}/tracing/agent.h +0 -0
- /package/src/headers/{14 → 22}/tracing/trace_event_common.h +0 -0
- /package/src/headers/{18 → 22}/tty_wrap.h +0 -0
- /package/src/headers/{16 → 24}/aliased_struct-inl.h +0 -0
- /package/src/headers/{16 → 24}/aliased_struct.h +0 -0
- /package/src/headers/{18 → 24}/callback_queue-inl.h +0 -0
- /package/src/headers/{16 → 24}/connect_wrap.h +0 -0
- /package/src/headers/{16 → 24}/connection_wrap.h +0 -0
- /package/src/headers/{18 → 24}/crypto/crypto_spkac.h +0 -0
- /package/src/headers/{18 → 24}/crypto/crypto_timing.h +0 -0
- /package/src/headers/{16 → 24}/diagnosticfilename-inl.h +0 -0
- /package/src/headers/{16 → 24}/inspector_io.h +0 -0
- /package/src/headers/{16 → 24}/inspector_socket.h +0 -0
- /package/src/headers/{16 → 24}/inspector_socket_server.h +0 -0
- /package/src/headers/{16 → 24}/js_stream.h +0 -0
- /package/src/headers/{16 → 24}/node_dir.h +0 -0
- /package/src/headers/{18 → 24}/node_mem.h +0 -0
- /package/src/headers/{18 → 24}/node_mutex.h +0 -0
- /package/src/headers/{16 → 24}/node_object_wrap.h +0 -0
- /package/src/headers/{18 → 24}/node_process-inl.h +0 -0
- /package/src/headers/{14/tracing → 24}/node_trace_buffer.h +0 -0
- /package/src/headers/{14/tracing → 24}/node_trace_writer.h +0 -0
- /package/src/headers/{18 → 24}/pipe_wrap.h +0 -0
- /package/src/headers/{16/tracing → 24}/trace_event_common.h +0 -0
|
@@ -27,42 +27,13 @@
|
|
|
27
27
|
#include <cmath>
|
|
28
28
|
#include <cstring>
|
|
29
29
|
#include <locale>
|
|
30
|
+
#include <ranges>
|
|
31
|
+
#include "node_revert.h"
|
|
30
32
|
#include "util.h"
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
#
|
|
35
|
-
# undef BSWAP_2
|
|
36
|
-
#endif
|
|
37
|
-
#ifdef BSWAP_4
|
|
38
|
-
# undef BSWAP_4
|
|
39
|
-
#endif
|
|
40
|
-
#ifdef BSWAP_8
|
|
41
|
-
# undef BSWAP_8
|
|
42
|
-
#endif
|
|
43
|
-
|
|
44
|
-
#if defined(_MSC_VER)
|
|
45
|
-
#include <intrin.h>
|
|
46
|
-
#define BSWAP_2(x) _byteswap_ushort(x)
|
|
47
|
-
#define BSWAP_4(x) _byteswap_ulong(x)
|
|
48
|
-
#define BSWAP_8(x) _byteswap_uint64(x)
|
|
49
|
-
#else
|
|
50
|
-
#define BSWAP_2(x) ((x) << 8) | ((x) >> 8)
|
|
51
|
-
#define BSWAP_4(x) \
|
|
52
|
-
(((x) & 0xFF) << 24) | \
|
|
53
|
-
(((x) & 0xFF00) << 8) | \
|
|
54
|
-
(((x) >> 8) & 0xFF00) | \
|
|
55
|
-
(((x) >> 24) & 0xFF)
|
|
56
|
-
#define BSWAP_8(x) \
|
|
57
|
-
(((x) & 0xFF00000000000000ull) >> 56) | \
|
|
58
|
-
(((x) & 0x00FF000000000000ull) >> 40) | \
|
|
59
|
-
(((x) & 0x0000FF0000000000ull) >> 24) | \
|
|
60
|
-
(((x) & 0x000000FF00000000ull) >> 8) | \
|
|
61
|
-
(((x) & 0x00000000FF000000ull) << 8) | \
|
|
62
|
-
(((x) & 0x0000000000FF0000ull) << 24) | \
|
|
63
|
-
(((x) & 0x000000000000FF00ull) << 40) | \
|
|
64
|
-
(((x) & 0x00000000000000FFull) << 56)
|
|
65
|
-
#endif
|
|
34
|
+
#ifdef _WIN32
|
|
35
|
+
#include <regex> // NOLINT(build/c++11)
|
|
36
|
+
#endif // _WIN32
|
|
66
37
|
|
|
67
38
|
#define CHAR_TEST(bits, name, expr) \
|
|
68
39
|
template <typename T> \
|
|
@@ -213,73 +184,9 @@ inline v8::Local<v8::String> OneByteString(v8::Isolate* isolate,
|
|
|
213
184
|
.ToLocalChecked();
|
|
214
185
|
}
|
|
215
186
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
#if defined(_MSC_VER)
|
|
220
|
-
if (AlignUp(data, sizeof(uint16_t)) == data) {
|
|
221
|
-
// MSVC has no strict aliasing, and is able to highly optimize this case.
|
|
222
|
-
uint16_t* data16 = reinterpret_cast<uint16_t*>(data);
|
|
223
|
-
size_t len16 = nbytes / sizeof(*data16);
|
|
224
|
-
for (size_t i = 0; i < len16; i++) {
|
|
225
|
-
data16[i] = BSWAP_2(data16[i]);
|
|
226
|
-
}
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
#endif
|
|
230
|
-
|
|
231
|
-
uint16_t temp;
|
|
232
|
-
for (size_t i = 0; i < nbytes; i += sizeof(temp)) {
|
|
233
|
-
memcpy(&temp, &data[i], sizeof(temp));
|
|
234
|
-
temp = BSWAP_2(temp);
|
|
235
|
-
memcpy(&data[i], &temp, sizeof(temp));
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
void SwapBytes32(char* data, size_t nbytes) {
|
|
240
|
-
CHECK_EQ(nbytes % 4, 0);
|
|
241
|
-
|
|
242
|
-
#if defined(_MSC_VER)
|
|
243
|
-
// MSVC has no strict aliasing, and is able to highly optimize this case.
|
|
244
|
-
if (AlignUp(data, sizeof(uint32_t)) == data) {
|
|
245
|
-
uint32_t* data32 = reinterpret_cast<uint32_t*>(data);
|
|
246
|
-
size_t len32 = nbytes / sizeof(*data32);
|
|
247
|
-
for (size_t i = 0; i < len32; i++) {
|
|
248
|
-
data32[i] = BSWAP_4(data32[i]);
|
|
249
|
-
}
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
#endif
|
|
253
|
-
|
|
254
|
-
uint32_t temp;
|
|
255
|
-
for (size_t i = 0; i < nbytes; i += sizeof(temp)) {
|
|
256
|
-
memcpy(&temp, &data[i], sizeof(temp));
|
|
257
|
-
temp = BSWAP_4(temp);
|
|
258
|
-
memcpy(&data[i], &temp, sizeof(temp));
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
void SwapBytes64(char* data, size_t nbytes) {
|
|
263
|
-
CHECK_EQ(nbytes % 8, 0);
|
|
264
|
-
|
|
265
|
-
#if defined(_MSC_VER)
|
|
266
|
-
if (AlignUp(data, sizeof(uint64_t)) == data) {
|
|
267
|
-
// MSVC has no strict aliasing, and is able to highly optimize this case.
|
|
268
|
-
uint64_t* data64 = reinterpret_cast<uint64_t*>(data);
|
|
269
|
-
size_t len64 = nbytes / sizeof(*data64);
|
|
270
|
-
for (size_t i = 0; i < len64; i++) {
|
|
271
|
-
data64[i] = BSWAP_8(data64[i]);
|
|
272
|
-
}
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
#endif
|
|
276
|
-
|
|
277
|
-
uint64_t temp;
|
|
278
|
-
for (size_t i = 0; i < nbytes; i += sizeof(temp)) {
|
|
279
|
-
memcpy(&temp, &data[i], sizeof(temp));
|
|
280
|
-
temp = BSWAP_8(temp);
|
|
281
|
-
memcpy(&data[i], &temp, sizeof(temp));
|
|
282
|
-
}
|
|
187
|
+
inline v8::Local<v8::String> OneByteString(v8::Isolate* isolate,
|
|
188
|
+
std::string_view str) {
|
|
189
|
+
return OneByteString(isolate, str.data(), str.size());
|
|
283
190
|
}
|
|
284
191
|
|
|
285
192
|
char ToLower(char c) {
|
|
@@ -349,7 +256,7 @@ T* UncheckedRealloc(T* pointer, size_t n) {
|
|
|
349
256
|
|
|
350
257
|
void* allocated = realloc(pointer, full_size);
|
|
351
258
|
|
|
352
|
-
if (
|
|
259
|
+
if (allocated == nullptr) [[unlikely]] {
|
|
353
260
|
// Tell V8 that memory is low and retry.
|
|
354
261
|
LowMemoryNotification();
|
|
355
262
|
allocated = realloc(pointer, full_size);
|
|
@@ -361,14 +268,12 @@ T* UncheckedRealloc(T* pointer, size_t n) {
|
|
|
361
268
|
// As per spec realloc behaves like malloc if passed nullptr.
|
|
362
269
|
template <typename T>
|
|
363
270
|
inline T* UncheckedMalloc(size_t n) {
|
|
364
|
-
if (n == 0) n = 1;
|
|
365
271
|
return UncheckedRealloc<T>(nullptr, n);
|
|
366
272
|
}
|
|
367
273
|
|
|
368
274
|
template <typename T>
|
|
369
275
|
inline T* UncheckedCalloc(size_t n) {
|
|
370
|
-
if (n == 0)
|
|
371
|
-
MultiplyWithOverflowCheck(sizeof(T), n);
|
|
276
|
+
if (MultiplyWithOverflowCheck(sizeof(T), n) == 0) return nullptr;
|
|
372
277
|
return static_cast<T*>(calloc(n, sizeof(T)));
|
|
373
278
|
}
|
|
374
279
|
|
|
@@ -403,11 +308,34 @@ inline char* UncheckedCalloc(size_t n) { return UncheckedCalloc<char>(n); }
|
|
|
403
308
|
// headers than we really need to.
|
|
404
309
|
void ThrowErrStringTooLong(v8::Isolate* isolate);
|
|
405
310
|
|
|
311
|
+
struct ArrayIterationData {
|
|
312
|
+
std::vector<v8::Global<v8::Value>>* out;
|
|
313
|
+
v8::Isolate* isolate = nullptr;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
inline v8::Array::CallbackResult PushItemToVector(uint32_t index,
|
|
317
|
+
v8::Local<v8::Value> element,
|
|
318
|
+
void* data) {
|
|
319
|
+
auto vec = static_cast<ArrayIterationData*>(data)->out;
|
|
320
|
+
auto isolate = static_cast<ArrayIterationData*>(data)->isolate;
|
|
321
|
+
vec->push_back(v8::Global<v8::Value>(isolate, element));
|
|
322
|
+
return v8::Array::CallbackResult::kContinue;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
v8::Maybe<void> FromV8Array(v8::Local<v8::Context> context,
|
|
326
|
+
v8::Local<v8::Array> js_array,
|
|
327
|
+
std::vector<v8::Global<v8::Value>>* out) {
|
|
328
|
+
uint32_t count = js_array->Length();
|
|
329
|
+
out->reserve(count);
|
|
330
|
+
ArrayIterationData data{out, context->GetIsolate()};
|
|
331
|
+
return js_array->Iterate(context, PushItemToVector, &data);
|
|
332
|
+
}
|
|
333
|
+
|
|
406
334
|
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
407
|
-
|
|
335
|
+
std::string_view str,
|
|
408
336
|
v8::Isolate* isolate) {
|
|
409
337
|
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
410
|
-
if (
|
|
338
|
+
if (str.size() >= static_cast<size_t>(v8::String::kMaxLength)) [[unlikely]] {
|
|
411
339
|
// V8 only has a TODO comment about adding an exception when the maximum
|
|
412
340
|
// string size is exceeded.
|
|
413
341
|
ThrowErrStringTooLong(isolate);
|
|
@@ -419,6 +347,32 @@ v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
|
419
347
|
.FromMaybe(v8::Local<v8::String>());
|
|
420
348
|
}
|
|
421
349
|
|
|
350
|
+
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
351
|
+
v8_inspector::StringView str,
|
|
352
|
+
v8::Isolate* isolate) {
|
|
353
|
+
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
354
|
+
if (str.length() >= static_cast<size_t>(v8::String::kMaxLength))
|
|
355
|
+
[[unlikely]] {
|
|
356
|
+
// V8 only has a TODO comment about adding an exception when the maximum
|
|
357
|
+
// string size is exceeded.
|
|
358
|
+
ThrowErrStringTooLong(isolate);
|
|
359
|
+
return v8::MaybeLocal<v8::Value>();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (str.is8Bit()) {
|
|
363
|
+
return v8::String::NewFromOneByte(isolate,
|
|
364
|
+
str.characters8(),
|
|
365
|
+
v8::NewStringType::kNormal,
|
|
366
|
+
str.length())
|
|
367
|
+
.FromMaybe(v8::Local<v8::String>());
|
|
368
|
+
}
|
|
369
|
+
return v8::String::NewFromTwoByte(isolate,
|
|
370
|
+
str.characters16(),
|
|
371
|
+
v8::NewStringType::kNormal,
|
|
372
|
+
str.length())
|
|
373
|
+
.FromMaybe(v8::Local<v8::String>());
|
|
374
|
+
}
|
|
375
|
+
|
|
422
376
|
template <typename T>
|
|
423
377
|
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
424
378
|
const std::vector<T>& vec,
|
|
@@ -436,6 +390,44 @@ v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
|
436
390
|
return handle_scope.Escape(v8::Array::New(isolate, arr.out(), arr.length()));
|
|
437
391
|
}
|
|
438
392
|
|
|
393
|
+
template <typename T>
|
|
394
|
+
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
395
|
+
const std::set<T>& set,
|
|
396
|
+
v8::Isolate* isolate) {
|
|
397
|
+
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
398
|
+
v8::Local<v8::Set> set_js = v8::Set::New(isolate);
|
|
399
|
+
v8::HandleScope handle_scope(isolate);
|
|
400
|
+
|
|
401
|
+
for (const T& entry : set) {
|
|
402
|
+
v8::Local<v8::Value> value;
|
|
403
|
+
if (!ToV8Value(context, entry, isolate).ToLocal(&value))
|
|
404
|
+
return {};
|
|
405
|
+
if (set_js->Add(context, value).IsEmpty())
|
|
406
|
+
return {};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return set_js;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
template <typename T, std::size_t U>
|
|
413
|
+
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
414
|
+
const std::ranges::elements_view<T, U>& vec,
|
|
415
|
+
v8::Isolate* isolate) {
|
|
416
|
+
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
417
|
+
v8::EscapableHandleScope handle_scope(isolate);
|
|
418
|
+
|
|
419
|
+
MaybeStackBuffer<v8::Local<v8::Value>, 128> arr(vec.size());
|
|
420
|
+
arr.SetLength(vec.size());
|
|
421
|
+
auto it = vec.begin();
|
|
422
|
+
for (size_t i = 0; i < vec.size(); ++i) {
|
|
423
|
+
if (!ToV8Value(context, *it, isolate).ToLocal(&arr[i]))
|
|
424
|
+
return v8::MaybeLocal<v8::Value>();
|
|
425
|
+
std::advance(it, 1);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return handle_scope.Escape(v8::Array::New(isolate, arr.out(), arr.length()));
|
|
429
|
+
}
|
|
430
|
+
|
|
439
431
|
template <typename T, typename U>
|
|
440
432
|
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
441
433
|
const std::unordered_map<T, U>& map,
|
|
@@ -456,12 +448,9 @@ v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
|
456
448
|
return handle_scope.Escape(ret);
|
|
457
449
|
}
|
|
458
450
|
|
|
459
|
-
template <typename T
|
|
460
|
-
v8::
|
|
461
|
-
|
|
462
|
-
v8::Isolate* isolate) {
|
|
463
|
-
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
464
|
-
|
|
451
|
+
template <typename T>
|
|
452
|
+
v8::Local<v8::Value> ConvertNumberToV8Value(v8::Isolate* isolate,
|
|
453
|
+
const T& number) {
|
|
465
454
|
using Limits = std::numeric_limits<T>;
|
|
466
455
|
// Choose Uint32, Int32, or Double depending on range checks.
|
|
467
456
|
// These checks should all collapse at compile time.
|
|
@@ -482,6 +471,43 @@ v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
|
482
471
|
return v8::Number::New(isolate, static_cast<double>(number));
|
|
483
472
|
}
|
|
484
473
|
|
|
474
|
+
template <typename T, typename>
|
|
475
|
+
v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
|
|
476
|
+
const T& number,
|
|
477
|
+
v8::Isolate* isolate) {
|
|
478
|
+
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
479
|
+
return ConvertNumberToV8Value(isolate, number);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
template <typename T>
|
|
483
|
+
v8::Local<v8::Array> ToV8ValuePrimitiveArray(v8::Local<v8::Context> context,
|
|
484
|
+
const std::vector<T>& vec,
|
|
485
|
+
v8::Isolate* isolate) {
|
|
486
|
+
static_assert(
|
|
487
|
+
std::is_same_v<T, bool> || std::is_integral_v<T> ||
|
|
488
|
+
std::is_floating_point_v<T>,
|
|
489
|
+
"Only primitive types (bool, integral, floating-point) are supported.");
|
|
490
|
+
|
|
491
|
+
if (isolate == nullptr) isolate = context->GetIsolate();
|
|
492
|
+
v8::EscapableHandleScope handle_scope(isolate);
|
|
493
|
+
|
|
494
|
+
v8::LocalVector<v8::Value> elements(isolate);
|
|
495
|
+
elements.reserve(vec.size());
|
|
496
|
+
|
|
497
|
+
for (const auto& value : vec) {
|
|
498
|
+
if constexpr (std::is_same_v<T, bool>) {
|
|
499
|
+
elements.emplace_back(v8::Boolean::New(isolate, value));
|
|
500
|
+
} else {
|
|
501
|
+
v8::Local<v8::Value> v = ConvertNumberToV8Value(isolate, value);
|
|
502
|
+
elements.emplace_back(v);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
v8::Local<v8::Array> arr =
|
|
507
|
+
v8::Array::New(isolate, elements.data(), elements.size());
|
|
508
|
+
return handle_scope.Escape(arr);
|
|
509
|
+
}
|
|
510
|
+
|
|
485
511
|
SlicedArguments::SlicedArguments(
|
|
486
512
|
const v8::FunctionCallbackInfo<v8::Value>& args, size_t start) {
|
|
487
513
|
const size_t length = static_cast<size_t>(args.Length());
|
|
@@ -493,11 +519,28 @@ SlicedArguments::SlicedArguments(
|
|
|
493
519
|
(*this)[i] = args[i + start];
|
|
494
520
|
}
|
|
495
521
|
|
|
522
|
+
template <typename T, size_t kStackStorageSize>
|
|
523
|
+
void MaybeStackBuffer<T, kStackStorageSize>::AllocateSufficientStorage(
|
|
524
|
+
size_t storage) {
|
|
525
|
+
CHECK(!IsInvalidated());
|
|
526
|
+
if (storage > capacity()) {
|
|
527
|
+
bool was_allocated = IsAllocated();
|
|
528
|
+
T* allocated_ptr = was_allocated ? buf_ : nullptr;
|
|
529
|
+
buf_ = Realloc(allocated_ptr, storage);
|
|
530
|
+
capacity_ = storage;
|
|
531
|
+
if (!was_allocated && length_ > 0)
|
|
532
|
+
memcpy(buf_, buf_st_, length_ * sizeof(buf_[0]));
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
length_ = storage;
|
|
536
|
+
}
|
|
537
|
+
|
|
496
538
|
template <typename T, size_t S>
|
|
497
539
|
ArrayBufferViewContents<T, S>::ArrayBufferViewContents(
|
|
498
540
|
v8::Local<v8::Value> value) {
|
|
499
|
-
|
|
500
|
-
|
|
541
|
+
DCHECK(value->IsArrayBufferView() || value->IsSharedArrayBuffer() ||
|
|
542
|
+
value->IsArrayBuffer());
|
|
543
|
+
ReadValue(value);
|
|
501
544
|
}
|
|
502
545
|
|
|
503
546
|
template <typename T, size_t S>
|
|
@@ -518,15 +561,35 @@ void ArrayBufferViewContents<T, S>::Read(v8::Local<v8::ArrayBufferView> abv) {
|
|
|
518
561
|
static_assert(sizeof(T) == 1, "Only supports one-byte data at the moment");
|
|
519
562
|
length_ = abv->ByteLength();
|
|
520
563
|
if (length_ > sizeof(stack_storage_) || abv->HasBuffer()) {
|
|
521
|
-
data_ = static_cast<T*>(abv->Buffer()->
|
|
522
|
-
abv->ByteOffset();
|
|
564
|
+
data_ = static_cast<T*>(abv->Buffer()->Data()) + abv->ByteOffset();
|
|
523
565
|
} else {
|
|
524
566
|
abv->CopyContents(stack_storage_, sizeof(stack_storage_));
|
|
525
567
|
data_ = stack_storage_;
|
|
526
568
|
}
|
|
527
569
|
}
|
|
528
570
|
|
|
529
|
-
|
|
571
|
+
template <typename T, size_t S>
|
|
572
|
+
void ArrayBufferViewContents<T, S>::ReadValue(v8::Local<v8::Value> buf) {
|
|
573
|
+
static_assert(sizeof(T) == 1, "Only supports one-byte data at the moment");
|
|
574
|
+
DCHECK(buf->IsArrayBufferView() || buf->IsSharedArrayBuffer() ||
|
|
575
|
+
buf->IsArrayBuffer());
|
|
576
|
+
|
|
577
|
+
if (buf->IsArrayBufferView()) {
|
|
578
|
+
Read(buf.As<v8::ArrayBufferView>());
|
|
579
|
+
} else if (buf->IsArrayBuffer()) {
|
|
580
|
+
auto ab = buf.As<v8::ArrayBuffer>();
|
|
581
|
+
length_ = ab->ByteLength();
|
|
582
|
+
data_ = static_cast<T*>(ab->Data());
|
|
583
|
+
was_detached_ = ab->WasDetached();
|
|
584
|
+
} else {
|
|
585
|
+
CHECK(buf->IsSharedArrayBuffer());
|
|
586
|
+
auto sab = buf.As<v8::SharedArrayBuffer>();
|
|
587
|
+
length_ = sab->ByteLength();
|
|
588
|
+
data_ = static_cast<T*>(sab->Data());
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
// ECMA-262, 15th edition, 21.1.2.5. Number.isSafeInteger
|
|
530
593
|
inline bool IsSafeJsInt(v8::Local<v8::Value> v) {
|
|
531
594
|
if (!v->IsNumber()) return false;
|
|
532
595
|
double v_d = v.As<v8::Number>()->Value();
|
|
@@ -537,11 +600,11 @@ inline bool IsSafeJsInt(v8::Local<v8::Value> v) {
|
|
|
537
600
|
return false;
|
|
538
601
|
}
|
|
539
602
|
|
|
540
|
-
constexpr size_t FastStringKey::HashImpl(
|
|
603
|
+
constexpr size_t FastStringKey::HashImpl(std::string_view str) {
|
|
541
604
|
// Low-quality hash (djb2), but just fine for current use cases.
|
|
542
605
|
size_t h = 5381;
|
|
543
|
-
|
|
544
|
-
h = h * 33 +
|
|
606
|
+
for (const char c : str) {
|
|
607
|
+
h = h * 33 + c;
|
|
545
608
|
}
|
|
546
609
|
return h;
|
|
547
610
|
}
|
|
@@ -552,22 +615,95 @@ constexpr size_t FastStringKey::Hash::operator()(
|
|
|
552
615
|
}
|
|
553
616
|
|
|
554
617
|
constexpr bool FastStringKey::operator==(const FastStringKey& other) const {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
618
|
+
return name_ == other.name_;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
consteval FastStringKey::FastStringKey(std::string_view name)
|
|
622
|
+
: FastStringKey(name, 0) {}
|
|
623
|
+
|
|
624
|
+
constexpr FastStringKey FastStringKey::AllowDynamic(std::string_view name) {
|
|
625
|
+
return FastStringKey(name, 0);
|
|
562
626
|
}
|
|
563
627
|
|
|
564
|
-
constexpr FastStringKey::FastStringKey(
|
|
565
|
-
|
|
628
|
+
constexpr FastStringKey::FastStringKey(std::string_view name, int dummy)
|
|
629
|
+
: name_(name), cached_hash_(HashImpl(name)) {}
|
|
566
630
|
|
|
567
|
-
constexpr
|
|
631
|
+
constexpr std::string_view FastStringKey::as_string_view() const {
|
|
568
632
|
return name_;
|
|
569
633
|
}
|
|
570
634
|
|
|
635
|
+
// Converts a V8 numeric value to a corresponding C++ primitive or enum type.
|
|
636
|
+
template <typename T,
|
|
637
|
+
bool loose = false,
|
|
638
|
+
typename = std::enable_if_t<std::numeric_limits<T>::is_specialized ||
|
|
639
|
+
std::is_enum_v<T>>>
|
|
640
|
+
T FromV8Value(v8::Local<v8::Value> value) {
|
|
641
|
+
if constexpr (std::is_enum_v<T>) {
|
|
642
|
+
using Underlying = std::underlying_type_t<T>;
|
|
643
|
+
return static_cast<T>(FromV8Value<Underlying, loose>(value));
|
|
644
|
+
} else if constexpr (std::is_integral_v<T> && std::is_unsigned_v<T>) {
|
|
645
|
+
static_assert(
|
|
646
|
+
std::numeric_limits<T>::max() <= std::numeric_limits<uint32_t>::max() &&
|
|
647
|
+
std::numeric_limits<T>::min() >=
|
|
648
|
+
std::numeric_limits<uint32_t>::min(),
|
|
649
|
+
"Type is out of unsigned integer range");
|
|
650
|
+
if constexpr (!loose) {
|
|
651
|
+
CHECK(value->IsUint32());
|
|
652
|
+
} else {
|
|
653
|
+
CHECK(value->IsNumber());
|
|
654
|
+
}
|
|
655
|
+
return static_cast<T>(value.As<v8::Uint32>()->Value());
|
|
656
|
+
} else if constexpr (std::is_integral_v<T> && std::is_signed_v<T>) {
|
|
657
|
+
static_assert(
|
|
658
|
+
std::numeric_limits<T>::max() <= std::numeric_limits<int32_t>::max() &&
|
|
659
|
+
std::numeric_limits<T>::min() >=
|
|
660
|
+
std::numeric_limits<int32_t>::min(),
|
|
661
|
+
"Type is out of signed integer range");
|
|
662
|
+
if constexpr (!loose) {
|
|
663
|
+
CHECK(value->IsInt32());
|
|
664
|
+
} else {
|
|
665
|
+
CHECK(value->IsNumber());
|
|
666
|
+
}
|
|
667
|
+
return static_cast<T>(value.As<v8::Int32>()->Value());
|
|
668
|
+
} else {
|
|
669
|
+
static_assert(std::is_floating_point_v<T>,
|
|
670
|
+
"Type must be arithmetic or enum.");
|
|
671
|
+
CHECK(value->IsNumber());
|
|
672
|
+
return static_cast<T>(value.As<v8::Number>()->Value());
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
#ifdef _WIN32
|
|
677
|
+
inline bool IsWindowsBatchFile(const char* filename) {
|
|
678
|
+
std::string file_with_extension = filename;
|
|
679
|
+
// Regex to match the last extension part after the last dot, ignoring
|
|
680
|
+
// trailing spaces and dots
|
|
681
|
+
std::regex extension_regex(R"(\.([a-zA-Z0-9]+)\s*[\.\s]*$)");
|
|
682
|
+
std::smatch match;
|
|
683
|
+
std::string extension;
|
|
684
|
+
|
|
685
|
+
if (std::regex_search(file_with_extension, match, extension_regex)) {
|
|
686
|
+
extension = ToLower(match[1].str());
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
return !extension.empty() && (extension == "cmd" || extension == "bat");
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
inline std::wstring ConvertToWideString(const std::string& str,
|
|
693
|
+
UINT code_page) {
|
|
694
|
+
int size_needed = MultiByteToWideChar(
|
|
695
|
+
code_page, 0, &str[0], static_cast<int>(str.size()), nullptr, 0);
|
|
696
|
+
std::wstring wstrTo(size_needed, 0);
|
|
697
|
+
MultiByteToWideChar(code_page,
|
|
698
|
+
0,
|
|
699
|
+
&str[0],
|
|
700
|
+
static_cast<int>(str.size()),
|
|
701
|
+
&wstrTo[0],
|
|
702
|
+
size_needed);
|
|
703
|
+
return wstrTo;
|
|
704
|
+
}
|
|
705
|
+
#endif // _WIN32
|
|
706
|
+
|
|
571
707
|
} // namespace node
|
|
572
708
|
|
|
573
709
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|