blob: 1bb7b0bee19f9b7d8d9d2a5c2df429a0db0e413c [file] [log] [blame]
// Flags: --pending-deprecation --no-warnings
'use strict';
const common = require('../common');
const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
'issues. Please use the Buffer.alloc(), ' +
'Buffer.allocUnsafe(), or Buffer.from() methods instead.';
common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005');
// 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);