Skip to content

Fixing udp.d.ts #1487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: public
Choose a base branch
from

Conversation

linfan68
Copy link

Found an Error on the .d.ts file (Buffer should be the 3rd argument), refer to different native c code:

xsmcGetBufferReadable(xsArg(2), &buffer, &byteLength);

xsmcGetBufferReadable(xsArg(2), &buffer, &byteLength);

xsmcGetBufferReadable(xsArg(2), &buffer, &byteLength);

xsmcGetBufferReadable(xsArg(2), &buffer, &byteLength);

@phoddie
Copy link
Collaborator

phoddie commented Apr 22, 2025

Yikes!

You are correct that udp.d.ts is out of sync with the implementations. But.... the implementations are wrong! Checking the standard for UDP, the buffer argument is first. That's consistent with the IO Class Pattern which always defines the first argument as the data to be written and leaves the remaining arguments, if any, to the particular class.

I think the implementations should be fixed. That will break some code. Best to do that sooner than later. For the transition, I can check for the first argument being a string and issue a specific exception about the needed change.

mkellner pushed a commit that referenced this pull request May 13, 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