Skip to content
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

feat(ext/ffi): support null in buffer argument #12823

Closed
wants to merge 8 commits into from

Conversation

DjDeveloperr
Copy link
Contributor

@DjDeveloperr DjDeveloperr commented Nov 20, 2021

  • Adds support for null in buffer argument. Corresponds to nullptr in FFI.
  • Adds relevant test case.

Fixes #12809

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

@DjDeveloperr tentatively this looks good to me, but please update type declarations to reflect that if buffer is null then buffer length shouldn't be passed as the next argument. Also an update to manual would be appreciated too.

@DjDeveloperr
Copy link
Contributor Author

Do I add that to type declarations of Deno.ForeignFunction's parameters field? I didn't quite get as passing length of buffer as next argument is not required.

@bartlomieju
Copy link
Member

bartlomieju commented Nov 20, 2021

Do I add that to type declarations of Deno.ForeignFunction's parameters field? I didn't quite get as passing length of buffer as next argument is not required.

I guess you don't need to add any types to ForeignFunction, but I'd be good to add some examples into the JSDoc for it.

@DjDeveloperr
Copy link
Contributor Author

@bartlomieju Added an example for buffer argument and some notes about null buffer argument in JS doc.

@DjDeveloperr
Copy link
Contributor Author

Looks like #12828 adds this too.. I guess I'll close this.

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.

feature request: support for null value in FFI buffer argument
2 participants