Skip to content

Commit b409b7e

Browse files
committed
lib: runtime deprecate SlowBuffer
1 parent e49cf7a commit b409b7e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc/api/deprecations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ Type: End-of-Life
695695

696696
<!-- YAML
697697
changes:
698+
- version: REPLACEME
699+
pr-url: https://github.com/nodejs/node/pull/55175
700+
description: Runtime deprecation.
698701
- version: v6.12.0
699702
pr-url: https://github.com/nodejs/node/pull/10116
700703
description: A deprecation code has been assigned.
@@ -703,7 +706,7 @@ changes:
703706
description: Documentation-only deprecation.
704707
-->
705708

706-
Type: Documentation-only
709+
Type: Runtime
707710

708711
The [`SlowBuffer`][] class is deprecated. Please use
709712
[`Buffer.allocUnsafeSlow(size)`][] instead.

lib/buffer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const {
8888
kIsEncodingSymbol,
8989
defineLazyProperties,
9090
encodingsMap,
91+
deprecate,
9192
} = require('internal/util');
9293
const {
9394
isAnyArrayBuffer,
@@ -1322,7 +1323,10 @@ function isAscii(input) {
13221323

13231324
module.exports = {
13241325
Buffer,
1325-
SlowBuffer,
1326+
SlowBuffer: deprecate(
1327+
SlowBuffer,
1328+
'SlowBuffer() is deprecated. Please use Buffer.allowUnsafeSlow()',
1329+
'DEP0030'),
13261330
transcode,
13271331
isUtf8,
13281332
isAscii,

0 commit comments

Comments
 (0)