mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 02:06:12 +00:00

Remove unnecessary imports from: * test/parallel/test-buffer-nopendingdep-map.js * test/parallel/test-buffer-pending-deprecation.js * test/parallel/test-buffer-sharedarraybuffer.js * test/parallel/test-buffer-slow.js * test/parallel/test-buffer-tojson.js * test/parallel/test-buffer-zero-fill.js Refs: https://github.com/nodejs/node/issues/13836 PR-URL: https://github.com/nodejs/node/pull/13851 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
21 lines
696 B
JavaScript
21 lines
696 B
JavaScript
// Flags: --pending-deprecation --no-warnings
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' +
|
|
'recommended for use due to security and usability ' +
|
|
'concerns. Please use the new Buffer.alloc(), ' +
|
|
'Buffer.allocUnsafe(), or Buffer.from() construction ' +
|
|
'methods instead.';
|
|
|
|
common.expectWarning('DeprecationWarning', bufferWarning);
|
|
|
|
// This is used to make sure that a warning is only emitted once even though
|
|
// `new Buffer()` is called twice.
|
|
process.on('warning', common.mustCall());
|
|
|
|
new Buffer(10);
|
|
|
|
new Buffer(10);
|