1// Flags: --pending-deprecation --no-warnings
2'use strict';
3
4const common = require('../common');
5
6const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
7                      'issues. Please use the Buffer.alloc(), ' +
8                      'Buffer.allocUnsafe(), or Buffer.from() methods instead.';
9
10common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005');
11
12// This is used to make sure that a warning is only emitted once even though
13// `new Buffer()` is called twice.
14process.on('warning', common.mustCall());
15
16new Buffer(10);
17
18new Buffer(10);
19