mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
19 lines
711 B
JavaScript
19 lines
711 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if ('Bun' in globalThis) common.skip("BUN: we don't want to emit this warning");
|
|
|
|
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());
|
|
|
|
Error.prepareStackTrace = (err, trace) => new Buffer(10);
|
|
|
|
new Error().stack; // eslint-disable-line no-unused-expressions
|