lib: fix typos
PR-URL: https://github.com/nodejs/node/pull/13741 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
parent
878990498a
commit
c474f88987
@ -420,7 +420,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
|
|||||||
|
|
||||||
// lib/net.js expect this value to be non-zero if write hasn't been flushed
|
// lib/net.js expect this value to be non-zero if write hasn't been flushed
|
||||||
// immediately
|
// immediately
|
||||||
// TODO(indutny): rewise this solution, it might be 1 before handshake and
|
// TODO(indutny): revise this solution, it might be 1 before handshake and
|
||||||
// represent real writeQueueSize during regular writes.
|
// represent real writeQueueSize during regular writes.
|
||||||
ssl.writeQueueSize = 1;
|
ssl.writeQueueSize = 1;
|
||||||
|
|
||||||
@ -723,7 +723,7 @@ TLSSocket.prototype.getProtocol = function() {
|
|||||||
// outcomes:
|
// outcomes:
|
||||||
//
|
//
|
||||||
// A) verifyError returns null meaning the client's certificate is signed
|
// A) verifyError returns null meaning the client's certificate is signed
|
||||||
// by one of the server's CAs. The server know's the client idenity now
|
// by one of the server's CAs. The server now knows the client's identity
|
||||||
// and the client is authorized.
|
// and the client is authorized.
|
||||||
//
|
//
|
||||||
// B) For some reason the client's certificate is not acceptable -
|
// B) For some reason the client's certificate is not acceptable -
|
||||||
@ -993,7 +993,7 @@ function normalizeConnectArgs(listArgs) {
|
|||||||
var cb = args[1];
|
var cb = args[1];
|
||||||
|
|
||||||
// If args[0] was options, then normalize dealt with it.
|
// If args[0] was options, then normalize dealt with it.
|
||||||
// If args[0] is port, or args[0], args[1] is host,port, we need to
|
// If args[0] is port, or args[0], args[1] is host, port, we need to
|
||||||
// find the options and merge them in, normalize's options has only
|
// find the options and merge them in, normalize's options has only
|
||||||
// the host/port/path args that it knows about, not the tls options.
|
// the host/port/path args that it knows about, not the tls options.
|
||||||
// This means that options.host overrides a host arg.
|
// This means that options.host overrides a host arg.
|
||||||
|
@ -120,7 +120,7 @@ function showFlaggedDeprecation() {
|
|||||||
if (bufferWarn) {
|
if (bufferWarn) {
|
||||||
// This is a *pending* deprecation warning. It is not emitted by
|
// This is a *pending* deprecation warning. It is not emitted by
|
||||||
// default unless the --pending-deprecation command-line flag is
|
// default unless the --pending-deprecation command-line flag is
|
||||||
// used or the NODE_PENDING_DEPRECATION=1 envvar is set.
|
// used or the NODE_PENDING_DEPRECATION=1 env var is set.
|
||||||
process.emitWarning(bufferWarning, 'DeprecationWarning', 'DEP0005');
|
process.emitWarning(bufferWarning, 'DeprecationWarning', 'DEP0005');
|
||||||
bufferWarn = false;
|
bufferWarn = false;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ const doFlaggedDeprecation =
|
|||||||
function() {};
|
function() {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Buffer() construtor is deprecated in documentation and should not be
|
* The Buffer() constructor is deprecated in documentation and should not be
|
||||||
* used moving forward. Rather, developers should use one of the three new
|
* used moving forward. Rather, developers should use one of the three new
|
||||||
* factory APIs: Buffer.from(), Buffer.allocUnsafe() or Buffer.alloc() based on
|
* factory APIs: Buffer.from(), Buffer.allocUnsafe() or Buffer.alloc() based on
|
||||||
* their specific needs. There is no runtime deprecation because of the extent
|
* their specific needs. There is no runtime deprecation because of the extent
|
||||||
@ -217,7 +217,7 @@ Buffer.alloc = function(size, fill, encoding) {
|
|||||||
// Since we are filling anyway, don't zero fill initially.
|
// Since we are filling anyway, don't zero fill initially.
|
||||||
// Only pay attention to encoding if it's a string. This
|
// Only pay attention to encoding if it's a string. This
|
||||||
// prevents accidentally sending in a number that would
|
// prevents accidentally sending in a number that would
|
||||||
// be interpretted as a start offset.
|
// be interpreted as a start offset.
|
||||||
if (typeof encoding !== 'string')
|
if (typeof encoding !== 'string')
|
||||||
encoding = undefined;
|
encoding = undefined;
|
||||||
return createUnsafeBuffer(size).fill(fill, encoding);
|
return createUnsafeBuffer(size).fill(fill, encoding);
|
||||||
|
@ -1620,7 +1620,7 @@ fs.realpathSync = function realpathSync(p, options) {
|
|||||||
knownHard[base] = true;
|
knownHard[base] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk down the path, swapping out linked pathparts for their real
|
// walk down the path, swapping out linked path parts for their real
|
||||||
// values
|
// values
|
||||||
// NB: p.length changes.
|
// NB: p.length changes.
|
||||||
while (pos < p.length) {
|
while (pos < p.length) {
|
||||||
@ -1747,7 +1747,7 @@ fs.realpath = function realpath(p, options, callback) {
|
|||||||
process.nextTick(LOOP);
|
process.nextTick(LOOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk down the path, swapping out linked pathparts for their real
|
// walk down the path, swapping out linked path parts for their real
|
||||||
// values
|
// values
|
||||||
function LOOP() {
|
function LOOP() {
|
||||||
// stop if scanned past end of path
|
// stop if scanned past end of path
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const EventEmitter = require('events');
|
const EventEmitter = require('events');
|
||||||
|
|
||||||
// This object keep track of the socket there are sended
|
// This object keeps track of the sockets that are sent
|
||||||
class SocketListSend extends EventEmitter {
|
class SocketListSend extends EventEmitter {
|
||||||
constructor(child, key) {
|
constructor(child, key) {
|
||||||
super();
|
super();
|
||||||
@ -52,7 +52,7 @@ class SocketListSend extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This object keep track of the socket there are received
|
// This object keeps track of the sockets that are received
|
||||||
class SocketListReceive extends EventEmitter {
|
class SocketListReceive extends EventEmitter {
|
||||||
constructor(child, key) {
|
constructor(child, key) {
|
||||||
super();
|
super();
|
||||||
@ -93,7 +93,7 @@ class SocketListReceive extends EventEmitter {
|
|||||||
add(obj) {
|
add(obj) {
|
||||||
this.connections++;
|
this.connections++;
|
||||||
|
|
||||||
// Notify previous owner of socket about its state change
|
// Notify the previous owner of the socket about its state change
|
||||||
obj.socket.once('close', () => {
|
obj.socket.once('close', () => {
|
||||||
this.connections--;
|
this.connections--;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ function REPLServer(prompt,
|
|||||||
|
|
||||||
if (breakEvalOnSigint && eval_) {
|
if (breakEvalOnSigint && eval_) {
|
||||||
// Allowing this would not reflect user expectations.
|
// Allowing this would not reflect user expectations.
|
||||||
// breakEvalOnSigint affects only the behaviour of the default eval().
|
// breakEvalOnSigint affects only the behavior of the default eval().
|
||||||
throw new errors.Error('ERR_INVALID_REPL_EVAL_CONFIG');
|
throw new errors.Error('ERR_INVALID_REPL_EVAL_CONFIG');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ REPLServer.prototype.complete = function() {
|
|||||||
function complete(line, callback) {
|
function complete(line, callback) {
|
||||||
// There may be local variables to evaluate, try a nested REPL
|
// There may be local variables to evaluate, try a nested REPL
|
||||||
if (this.bufferedCommand !== undefined && this.bufferedCommand.length) {
|
if (this.bufferedCommand !== undefined && this.bufferedCommand.length) {
|
||||||
// Get a new array of inputed lines
|
// Get a new array of inputted lines
|
||||||
var tmp = this.lines.slice();
|
var tmp = this.lines.slice();
|
||||||
// Kill off all function declarations to push all local variables into
|
// Kill off all function declarations to push all local variables into
|
||||||
// global scope
|
// global scope
|
||||||
|
@ -467,7 +467,7 @@ exports.setTimeout = setTimeout;
|
|||||||
function createSingleTimeout(callback, after, args) {
|
function createSingleTimeout(callback, after, args) {
|
||||||
after *= 1; // coalesce to number or NaN
|
after *= 1; // coalesce to number or NaN
|
||||||
if (!(after >= 1 && after <= TIMEOUT_MAX))
|
if (!(after >= 1 && after <= TIMEOUT_MAX))
|
||||||
after = 1; // schedule on next tick, follows browser behaviour
|
after = 1; // schedule on next tick, follows browser behavior
|
||||||
|
|
||||||
var timer = new Timeout(after, callback, args);
|
var timer = new Timeout(after, callback, args);
|
||||||
if (process.domain)
|
if (process.domain)
|
||||||
@ -556,7 +556,7 @@ exports.setInterval = function(callback, repeat, arg1, arg2, arg3) {
|
|||||||
function createRepeatTimeout(callback, repeat, args) {
|
function createRepeatTimeout(callback, repeat, args) {
|
||||||
repeat *= 1; // coalesce to number or NaN
|
repeat *= 1; // coalesce to number or NaN
|
||||||
if (!(repeat >= 1 && repeat <= TIMEOUT_MAX))
|
if (!(repeat >= 1 && repeat <= TIMEOUT_MAX))
|
||||||
repeat = 1; // schedule on next tick, follows browser behaviour
|
repeat = 1; // schedule on next tick, follows browser behavior
|
||||||
|
|
||||||
var timer = new Timeout(repeat, callback, args);
|
var timer = new Timeout(repeat, callback, args);
|
||||||
timer._repeat = repeat;
|
timer._repeat = repeat;
|
||||||
|
@ -32,7 +32,7 @@ const { isUint8Array } = process.binding('util');
|
|||||||
|
|
||||||
// Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations
|
// Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations
|
||||||
// every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more
|
// every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more
|
||||||
// renegotations are seen. The settings are applied to all remote client
|
// renegotiations are seen. The settings are applied to all remote client
|
||||||
// connections.
|
// connections.
|
||||||
exports.CLIENT_RENEG_LIMIT = 3;
|
exports.CLIENT_RENEG_LIMIT = 3;
|
||||||
exports.CLIENT_RENEG_WINDOW = 600;
|
exports.CLIENT_RENEG_WINDOW = 600;
|
||||||
|
@ -77,7 +77,7 @@ function WriteStream(fd) {
|
|||||||
|
|
||||||
// Prevents interleaved or dropped stdout/stderr output for terminals.
|
// Prevents interleaved or dropped stdout/stderr output for terminals.
|
||||||
// As noted in the following reference, local TTYs tend to be quite fast and
|
// As noted in the following reference, local TTYs tend to be quite fast and
|
||||||
// this behaviour has become expected due historical functionality on OS X,
|
// this behavior has become expected due historical functionality on OS X,
|
||||||
// even though it was originally intended to change in v1.0.2 (Libuv 1.2.1).
|
// even though it was originally intended to change in v1.0.2 (Libuv 1.2.1).
|
||||||
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
|
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
|
||||||
this._handle.setBlocking(true);
|
this._handle.setBlocking(true);
|
||||||
|
@ -449,7 +449,7 @@ function autoEscapeStr(rest) {
|
|||||||
var lastEscapedPos = 0;
|
var lastEscapedPos = 0;
|
||||||
for (var i = 0; i < rest.length; ++i) {
|
for (var i = 0; i < rest.length; ++i) {
|
||||||
// Manual switching is faster than using a Map/Object.
|
// Manual switching is faster than using a Map/Object.
|
||||||
// `escaped` contains substring up to the last escaped cahracter.
|
// `escaped` contains substring up to the last escaped character.
|
||||||
switch (rest.charCodeAt(i)) {
|
switch (rest.charCodeAt(i)) {
|
||||||
case 9: // '\t'
|
case 9: // '\t'
|
||||||
// Concat if there are ordinary characters in the middle.
|
// Concat if there are ordinary characters in the middle.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user