Skip to content

Commit 030f51b

Browse files
authoredMay 7, 2024··
fix: Add supported version to Buffer constructor (#266)
1 parent c7a014c commit 030f51b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎lib/unsupported-features/node-builtins-modules/buffer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const buffer = {
2323
},
2424
Buffer: {
2525
[READ]: { supported: ["0.1.90"] },
26-
[CONSTRUCT]: { deprecated: ["6.0.0"] },
26+
[CONSTRUCT]: { supported: ["0.1.90"], deprecated: ["6.0.0"] },
2727
alloc: { [READ]: { supported: ["5.10.0", "4.5.0"] } },
2828
allocUnsafe: { [READ]: { supported: ["5.10.0", "4.5.0"] } },
2929
allocUnsafeSlow: { [READ]: { supported: ["5.12.0", "4.5.0"] } },

‎tests/lib/rules/no-unsupported-features/node-builtins.js

+4
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ new RuleTester({ languageOptions: { sourceType: "module" } }).run(
218218
},
219219
],
220220
},
221+
{
222+
code: "new Buffer(123)",
223+
options: [{ version: "6.0.0" }],
224+
},
221225
],
222226
invalid: [
223227
{

0 commit comments

Comments
 (0)
Please sign in to comment.