mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
errors: drop pronouns from ERR_WORKER_PATH message
This commit drops pronouns from the ERR_WORKER_PATH message, and also shortens the text a bit. PR-URL: https://github.com/nodejs/node/pull/32285 Refs: https://github.com/nodejs/node/pull/31664 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
@@ -1425,8 +1425,7 @@ E('ERR_WORKER_PATH', (filename) =>
|
||||
'The worker script or module filename must be an absolute path or a ' +
|
||||
'relative path starting with \'./\' or \'../\'.' +
|
||||
(filename.startsWith('file://') ?
|
||||
' If you want to pass a file:// URL, you must wrap it around `new URL`.' :
|
||||
''
|
||||
' Wrap file:// URLs with `new URL`.' : ''
|
||||
) +
|
||||
` Received "${filename}"`,
|
||||
TypeError);
|
||||
|
||||
@@ -31,12 +31,12 @@ const { Worker } = require('worker_threads');
|
||||
{
|
||||
assert.throws(
|
||||
() => { new Worker('file:///file_url'); },
|
||||
/If you want to pass a file:\/\/ URL, you must wrap it around `new URL`/
|
||||
/Wrap file:\/\/ URLs with `new URL`/
|
||||
);
|
||||
assert.throws(
|
||||
() => { new Worker('relative_no_dot'); },
|
||||
// eslint-disable-next-line node-core/no-unescaped-regexp-dot
|
||||
/^((?!If you want to pass a file:\/\/ URL, you must wrap it around `new URL`).)*$/s
|
||||
/^((?!Wrap file:\/\/ URLs with `new URL`).)*$/s
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user