镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

webidl: fix existing and add missing buffer source converters - #4503

Merged
KhafraDev merged 1 commit into
nodejs:mainfrom
Renegade334:webidl-buffer-source-converters
Sep 1, 2025
Merged

KhafraDev merged 1 commit into
nodejs:mainfrom
Renegade334:webidl-buffer-source-converters

Conversation

@Renegade334

Copy link
Copy Markdown
Member

This relates to...

Aims to provide support for a resolution for #4495.

Rationale

Factors contributing to the specification divergence for fetch/websockets as detailed in the linked issue are:

  • the required buffer source converters are missing;
  • the existing buffer source converters are not used within the codebase;
  • those that do exist are out-of-date with the IDL standard.

Changes

Changes to existing converters:

  • ArrayBuffer used to convert to either ArrayBuffer or ArrayBuffer | SharedArrayBuffer, depending on the presence or absence of the [AllowShared] attribute. Subsequent changes to the standard have separated these out into separate IDL types, and so this converter has been split into two.
  • The ArrayBuffer and SharedArrayBuffer converters correctly handle the presence or absence of the [AllowResizable] attribute.
  • The remaining buffer source converters correctly handle the presence or absence of the [AllowShared] and [AllowResizable] attributes.

New converters:

  • ArrayBufferView
  • BufferSource
  • AllowSharedBufferSource

Breaking Changes and Deprecations

As mentioned, this does not affect the current behaviour of undici web APIs, as they do not use these converters at present.

Status

@KhafraDev KhafraDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't fix the issue, but as you mentioned, provides a resolution to fixing it. Thanks!

@KhafraDev
KhafraDev merged commit b4019ee into nodejs:main Sep 1, 2025
@Renegade334
Renegade334 deleted the webidl-buffer-source-converters branch September 1, 2025 23:19
@github-actions github-actions Bot mentioned this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants