Rework lib/internal/webidl.js into a documented shared converter module that follows the Web IDL conversion algorithms more closely. Improvements: - Add documented converters and helper factories for primitive values, dictionaries, enums, sequences, interfaces, required arguments, integers, `Uint8Array`, and `BufferSource`. - Move WebCrypto onto the shared converters, while keeping compatibility wrappers for its existing `BufferSource` and `BigInteger` behavior. - Use shared converters from Blob, Performance, Web Locks, and structured clone option handling. - Add benchmarks for `ConvertToInt` and WebCrypto Web IDL converter hot paths. - Add focused tests for core converters, WebCrypto converters, integer conversion, and buffer source behavior. Fixes: - Make the shared `BufferSource` and `Uint8Array` converters reject resizable `ArrayBuffer` and growable `SharedArrayBuffer` backing stores unless explicitly allowed. WebCrypto preserves its legacy resizable backing-store behavior through compatibility wrappers until a semver-major follow-up can opt in to the stricter behavior. - Use Web IDL `ToNumber` and `ToString` behavior for BigInt, Symbol, and object primitive conversion. - Use exact BigInt modulo for 64-bit `ConvertToInt` wrapping and document the final Number approximation behavior. - Normalize mathematical modulo results to `+0` where Web IDL requires it. - Process inherited dictionaries in least-derived to most-derived order, sorting members only within each dictionary level. - Use `IteratorComplete` truthiness for sequence conversion. - Cover detached buffers, resizable-backed views, growable-backed views, cross-realm buffer sources, mutation-after-call behavior, inherited dictionary member order, and sequence iterator completion behavior. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/62979 Backport-PR-URL: https://github.com/nodejs/node/pull/63563 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> |
||
|---|---|---|
| .. | ||
| assert | ||
| async_local_storage | ||
| bootstrap | ||
| child_process | ||
| cluster | ||
| console | ||
| crypto | ||
| debugger | ||
| dns | ||
| encoding | ||
| errors | ||
| events | ||
| fs | ||
| http2 | ||
| inspector | ||
| legacy | ||
| main | ||
| modules | ||
| per_context | ||
| perf | ||
| process | ||
| quic | ||
| readline | ||
| repl | ||
| source_map | ||
| streams | ||
| test | ||
| test_runner | ||
| tls | ||
| util | ||
| v8 | ||
| vm | ||
| watch_mode | ||
| webstreams | ||
| worker | ||
| abort_controller.js | ||
| assert.js | ||
| async_context_frame.js | ||
| async_hooks.js | ||
| blob.js | ||
| blocklist.js | ||
| buffer.js | ||
| child_process.js | ||
| cli_table.js | ||
| constants.js | ||
| data_url.js | ||
| dgram.js | ||
| encoding.js | ||
| error_serdes.js | ||
| errors.js | ||
| event_target.js | ||
| file.js | ||
| fixed_queue.js | ||
| freelist.js | ||
| freeze_intrinsics.js | ||
| heap_utils.js | ||
| histogram.js | ||
| http.js | ||
| inspector_async_hook.js | ||
| inspector_network_tracking.js | ||
| js_stream_socket.js | ||
| linkedlist.js | ||
| locks.js | ||
| mime.js | ||
| navigator.js | ||
| net.js | ||
| options.js | ||
| priority_queue.js | ||
| promise_hooks.js | ||
| querystring.js | ||
| README.md | ||
| repl.js | ||
| socket_list.js | ||
| socketaddress.js | ||
| stream_base_commons.js | ||
| timers.js | ||
| trace_events_async_hooks.js | ||
| tty.js | ||
| url.js | ||
| util.js | ||
| v8_prof_polyfill.js | ||
| validators.js | ||
| vm.js | ||
| wasm_web_api.js | ||
| watchdog.js | ||
| webidl.js | ||
| webstorage.js | ||
| worker.js | ||
Internal Modules
The modules located in lib/internal directory are exclusively meant
for internal usage within the Node.js core. They are not intended to
be accessed via user modules require(). These modules may change at
any point in time. Relying on these internal modules outside the core
is not supported and can lead to unpredictable behavior.
In certain scenarios, accessing these internal modules for debugging or
experimental purposes might be necessary. Node.js provides the --expose-internals
flag to expose these modules to userland code. This flag only exists to
assist Node.js maintainers with debugging internals. It is not meant for
use outside the project.