• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4
5const bufferWarning = 'Buffer() is deprecated due to security and usability ' +
6                      'issues. Please use the Buffer.alloc(), ' +
7                      'Buffer.allocUnsafe(), or Buffer.from() methods instead.';
8
9common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005');
10
11// This is used to make sure that a warning is only emitted once even though
12// `new Buffer()` is called twice.
13process.on('warning', common.mustCall());
14
15Error.prepareStackTrace = (err, trace) => new Buffer(10);
16
17new Error().stack; // eslint-disable-line no-unused-expressions
18