mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
tools: non-Ascii linter for /lib only
Non-ASCII characters in /lib get compiled into the node binary, and may bloat the binary size unnecessarily. A linter rule may help prevent this. PR-URL: https://github.com/nodejs/node/pull/18043 Fixes: https://github.com/nodejs/node/issues/11209 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
This commit is contained in:
parent
591a8adeae
commit
c45afe8198
8 changed files with 71 additions and 5 deletions
|
@ -84,7 +84,7 @@ function createWriteErrorHandler(stream) {
|
|||
// If there was an error, it will be emitted on `stream` as
|
||||
// an `error` event. Adding a `once` listener will keep that error
|
||||
// from becoming an uncaught exception, but since the handler is
|
||||
// removed after the event, non-console.* writes won’t be affected.
|
||||
// removed after the event, non-console.* writes won't be affected.
|
||||
// we are only adding noop if there is no one else listening for 'error'
|
||||
if (stream.listenerCount('error') === 0) {
|
||||
stream.on('error', noop);
|
||||
|
@ -125,7 +125,7 @@ function write(ignoreErrors, stream, string, errorhandler, groupIndent) {
|
|||
// even in edge cases such as low stack space.
|
||||
if (e.message === MAX_STACK_MESSAGE && e.name === 'RangeError')
|
||||
throw e;
|
||||
// Sorry, there’s no proper way to pass along the error here.
|
||||
// Sorry, there's no proper way to pass along the error here.
|
||||
} finally {
|
||||
stream.removeListener('error', noop);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue