-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Buffer.slice
is deprecated
#40
Comments
PRs are welcome! 👍 |
I have been thinking about this one while updating the es-syntax. I think we should look to move I think its the best solution to adding prototype deprecation warnings. The one change I would make would be to make the callback required. 🤔 I was looking for a similar thing here too -- #180 (comment) Something like: import { definePrototypeMethodHandler } from "@eslint-community/eslint-utils"
definePrototypeMethodHandler(
context,
{ Buffer: ["slice"] },
({ node }) => context.report({
node: node,
messageId: "buffer#slice-deprecated"
}),
) What do you think @aladdin-add? |
Is this still an issue? @scagood |
I think it's a great thing to do... But I am not sure about the feasibility of it. I think it'd be great to track the prototypal depreciation and support, but I am starting to think it may be a little too hard 😔 |
Well, let's just document its limitations, and close this one. :) |
Yeah, agreed. |
It was bad that they overrided it in the first place...
https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#bufslicestart-end
Buffer don't even have a slice method that did the correct thing. slice is only an alias for subarray. and subarray is what ppl should have been using instead.
The text was updated successfully, but these errors were encountered: