lib,src,test: fix comments
PR-URL: https://github.com/nodejs/node/pull/20846 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
Родитель
dc29a3b386
Коммит
8d8b0bdf38
|
@ -834,7 +834,7 @@ Readable.prototype.removeListener = function(ev, fn) {
|
||||||
|
|
||||||
if (ev === 'readable') {
|
if (ev === 'readable') {
|
||||||
// We need to check if there is someone still listening to
|
// We need to check if there is someone still listening to
|
||||||
// to readable and reset the state. However this needs to happen
|
// readable and reset the state. However this needs to happen
|
||||||
// after readable has been emitted but before I/O (nextTick) to
|
// after readable has been emitted but before I/O (nextTick) to
|
||||||
// support once('readable', fn) cycles. This means that calling
|
// support once('readable', fn) cycles. This means that calling
|
||||||
// resume within the same tick will have no
|
// resume within the same tick will have no
|
||||||
|
@ -850,7 +850,7 @@ Readable.prototype.removeAllListeners = function(ev) {
|
||||||
|
|
||||||
if (ev === 'readable' || ev === undefined) {
|
if (ev === 'readable' || ev === undefined) {
|
||||||
// We need to check if there is someone still listening to
|
// We need to check if there is someone still listening to
|
||||||
// to readable and reset the state. However this needs to happen
|
// readable and reset the state. However this needs to happen
|
||||||
// after readable has been emitted but before I/O (nextTick) to
|
// after readable has been emitted but before I/O (nextTick) to
|
||||||
// support once('readable', fn) cycles. This means that calling
|
// support once('readable', fn) cycles. This means that calling
|
||||||
// resume within the same tick will have no
|
// resume within the same tick will have no
|
||||||
|
|
|
@ -2384,7 +2384,7 @@ static void EnvGetter(Local<Name> property,
|
||||||
arraysize(buffer));
|
arraysize(buffer));
|
||||||
// If result >= sizeof buffer the buffer was too small. That should never
|
// If result >= sizeof buffer the buffer was too small. That should never
|
||||||
// happen. If result == 0 and result != ERROR_SUCCESS the variable was not
|
// happen. If result == 0 and result != ERROR_SUCCESS the variable was not
|
||||||
// not found.
|
// found.
|
||||||
if ((result > 0 || GetLastError() == ERROR_SUCCESS) &&
|
if ((result > 0 || GetLastError() == ERROR_SUCCESS) &&
|
||||||
result < arraysize(buffer)) {
|
result < arraysize(buffer)) {
|
||||||
const uint16_t* two_byte_buffer = reinterpret_cast<const uint16_t*>(buffer);
|
const uint16_t* two_byte_buffer = reinterpret_cast<const uint16_t*>(buffer);
|
||||||
|
|
|
@ -70,7 +70,7 @@ inline StreamResource::~StreamResource() {
|
||||||
StreamListener* listener = listener_;
|
StreamListener* listener = listener_;
|
||||||
listener->OnStreamDestroy();
|
listener->OnStreamDestroy();
|
||||||
// Remove the listener if it didn’t remove itself. This makes the logic
|
// Remove the listener if it didn’t remove itself. This makes the logic
|
||||||
// logic in `OnStreamDestroy()` implementations easier, because they
|
// in `OnStreamDestroy()` implementations easier, because they
|
||||||
// may call generic cleanup functions which can just remove the
|
// may call generic cleanup functions which can just remove the
|
||||||
// listener unconditionally.
|
// listener unconditionally.
|
||||||
if (listener == listener_)
|
if (listener == listener_)
|
||||||
|
|
|
@ -134,7 +134,7 @@ bool NodeTraceBuffer::Flush() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempts to set current_buf_ such that it references a buffer that can
|
// Attempts to set current_buf_ such that it references a buffer that can
|
||||||
// can write at least one trace event. If both buffers are unavailable this
|
// write at least one trace event. If both buffers are unavailable this
|
||||||
// method returns false; otherwise it returns true.
|
// method returns false; otherwise it returns true.
|
||||||
bool NodeTraceBuffer::TryLoadAvailableBuffer() {
|
bool NodeTraceBuffer::TryLoadAvailableBuffer() {
|
||||||
InternalTraceBuffer* prev_buf = current_buf_.load();
|
InternalTraceBuffer* prev_buf = current_buf_.load();
|
||||||
|
|
|
@ -153,7 +153,7 @@ void NodeTraceWriter::WriteToFile(std::string&& str, int highest_request_id) {
|
||||||
write_req->str.length());
|
write_req->str.length());
|
||||||
request_mutex_.Lock();
|
request_mutex_.Lock();
|
||||||
// Manage a queue of WriteRequest objects because the behavior of uv_write is
|
// Manage a queue of WriteRequest objects because the behavior of uv_write is
|
||||||
// is undefined if the same WriteRequest object is used more than once
|
// undefined if the same WriteRequest object is used more than once
|
||||||
// between WriteCb calls. In addition, this allows us to keep track of the id
|
// between WriteCb calls. In addition, this allows us to keep track of the id
|
||||||
// of the latest write request that actually been completed.
|
// of the latest write request that actually been completed.
|
||||||
write_req_queue_.push(write_req);
|
write_req_queue_.push(write_req);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/*
|
/*
|
||||||
* This is a regression test for
|
* This is a regression test for
|
||||||
* https://github.com/nodejs/node-v0.x-archive/issues/15447 and
|
* https://github.com/nodejs/node-v0.x-archive/issues/15447 and
|
||||||
* and https://github.com/nodejs/node-v0.x-archive/issues/9333.
|
* https://github.com/nodejs/node-v0.x-archive/issues/9333.
|
||||||
*
|
*
|
||||||
* When a timer is added in another timer's callback, its underlying timer
|
* When a timer is added in another timer's callback, its underlying timer
|
||||||
* handle was started with a timeout that was actually incorrect.
|
* handle was started with a timeout that was actually incorrect.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче