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:
Sarat Addepalli 2018-01-08 23:16:27 +05:30 committed by Anna Henningsen
parent 591a8adeae
commit c45afe8198
No known key found for this signature in database
GPG key ID: 9C63F3A6CD2AD8F9
8 changed files with 71 additions and 5 deletions

View file

@ -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 wont 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, theres 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);
}