mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

A null character in the middle of an invalid URL was resulting in an error message that truncated the input string. This preserves the entire input string in the error message. Refs: https://github.com/nodejs/node/issues/39592 PR-URL: https://github.com/nodejs/node/pull/42263 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
9 lines
139 B
JavaScript
9 lines
139 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.throws(
|
|
() => { new URL('a\0b'); },
|
|
{ input: 'a\0b' }
|
|
);
|