Files
node/test/message/error_with_nul.js
T
Anna Henningsen 32e7e813e9 src: use custom fprintf alike to write errors to stderr
This allows printing errors that contain nul characters, for example.

Fixes: https://github.com/nodejs/node/issues/28761
Fixes: https://github.com/nodejs/node/issues/31218

PR-URL: https://github.com/nodejs/node/pull/31446
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-23 22:39:00 +01:00

12 lines
193 B
JavaScript

'use strict';
require('../common');
function test() {
const a = 'abc\0def';
console.error(a);
throw new Error(a);
}
Object.defineProperty(test, 'name', { value: 'fun\0name' });
test();