mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
lib: runtime deprecate SlowBuffer
PR-URL: https://github.com/nodejs/node/pull/55175 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
2545b9e02c
commit
019efe1453
@ -695,6 +695,9 @@ Type: End-of-Life
|
||||
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/55175
|
||||
description: Runtime deprecation.
|
||||
- version: v6.12.0
|
||||
pr-url: https://github.com/nodejs/node/pull/10116
|
||||
description: A deprecation code has been assigned.
|
||||
@ -703,7 +706,7 @@ changes:
|
||||
description: Documentation-only deprecation.
|
||||
-->
|
||||
|
||||
Type: Documentation-only
|
||||
Type: Runtime
|
||||
|
||||
The [`SlowBuffer`][] class is deprecated. Please use
|
||||
[`Buffer.allocUnsafeSlow(size)`][] instead.
|
||||
|
@ -88,6 +88,7 @@ const {
|
||||
kIsEncodingSymbol,
|
||||
defineLazyProperties,
|
||||
encodingsMap,
|
||||
deprecate,
|
||||
} = require('internal/util');
|
||||
const {
|
||||
isAnyArrayBuffer,
|
||||
@ -1322,7 +1323,10 @@ function isAscii(input) {
|
||||
|
||||
module.exports = {
|
||||
Buffer,
|
||||
SlowBuffer: deprecate(
|
||||
SlowBuffer,
|
||||
'SlowBuffer() is deprecated. Please use Buffer.allocUnsafeSlow()',
|
||||
'DEP0030'),
|
||||
transcode,
|
||||
isUtf8,
|
||||
isAscii,
|
||||
|
@ -1,12 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const buffer = require('buffer');
|
||||
const SlowBuffer = buffer.SlowBuffer;
|
||||
|
||||
const ones = [1, 1, 1, 1];
|
||||
|
||||
common.expectWarning(
|
||||
'DeprecationWarning',
|
||||
'SlowBuffer() is deprecated. Please use Buffer.allocUnsafeSlow()',
|
||||
'DEP0030'
|
||||
);
|
||||
|
||||
// Should create a Buffer
|
||||
let sb = SlowBuffer(4);
|
||||
assert(sb instanceof Buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user