node/test/message/error_with_nul.js
Geoffrey Booth d6e626d54c
test: remove cjs loader from stack traces
PR-URL: https://github.com/nodejs/node/pull/44197
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-08-14 21:59:02 +00:00

13 lines
220 B
JavaScript

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