-
Notifications
You must be signed in to change notification settings - Fork 469
Docstrings for ArrayBuffer #7594
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
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
commit: |
runtime/Stdlib_ArrayBuffer.resi
Outdated
ArrayBuffer.byteLength(sliced) == 8 | ||
``` | ||
*/ | ||
@send external sliceToEnd: (t, ~start: int) => t = "slice" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized: Do we actually need this? Can't we just make ~end
optional in slice
instead?
Same for Array.sliceToEnd
, String.sliceToEnd
.
Actually start
is also optional according to MDN.
So I think we should have the signature
@send external slice: (t, ~start: int=?, ~end: int=?) => t = "slice"
and deprecate sliceToEnd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I'll fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 09f1172
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Would you also create PRs for Array, String etc.?
Also mostly AI written, but again seems good.
#7546