mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc,src,test: fix typos in code comments
Correct miscellaneous spelling and grammar typos in code comments and documentation. No code identifiers or runtime logic were modified. Signed-off-by: Noah Webber <noah.webber@pmg.com> Assisted-by: Gemini PR-URL: https://github.com/nodejs/node/pull/66218 Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
1 parent
dbb0e6e164
commit
a74a0ee748
22 files changed
+31
-30
No files matched your search
@@ -30,7 +30,7 @@ class CoveredClass {
|
||||
}
|
||||
}
|
||||
|
||||
// Excercise coverage of functions:
|
||||
// Exercise coverage of functions:
|
||||
function add(x, y) {
|
||||
const mt = new CoveredClass(x, y);
|
||||
return mt.add();
|
||||
|
||||
@@ -8,7 +8,7 @@ const path = require('path');
|
||||
// checked into the source code. We use --version because the output
|
||||
// tends to be minimal and fewer operations are done to generate
|
||||
// these so that the startup cost is still dominated by a more
|
||||
// indispensible part of the CLI.
|
||||
// indispensable part of the CLI.
|
||||
// NOTE: not all tools are present in tarball hence need to filter
|
||||
const availableCli = [
|
||||
'tools/eslint/node_modules/eslint/bin/eslint.js',
|
||||
|
||||
@@ -120,7 +120,7 @@ const legacyWrapperList = new SafeSet([
|
||||
'util',
|
||||
]);
|
||||
|
||||
// The code bellow assumes that the two lists must not contain any modules
|
||||
// The code below assumes that the two lists must not contain any modules
|
||||
// beginning with "internal/".
|
||||
// Modules that can only be imported via the node: scheme.
|
||||
const schemelessBlockList = new SafeSet([
|
||||
|
||||
@@ -121,7 +121,7 @@ function embedderRunESM(content, filename) {
|
||||
const wrap = compileSourceTextModule(resourceName, content, kEmbedder, context);
|
||||
|
||||
// TODO(joyeecheung): we may want to return the v8::Module via a vm.SourceTextModule
|
||||
// when vm.SourceTextModule stablizes, or put it in an out parameter.
|
||||
// when vm.SourceTextModule stabilizes, or put it in an out parameter.
|
||||
return wrap.getNamespace();
|
||||
}
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ function createCJSModuleWrap(url, translateContext, parentURL) {
|
||||
!ObjectPrototypeHasOwnProperty(exports, exportName)) {
|
||||
continue;
|
||||
}
|
||||
// We might trigger a getter -> dont fail.
|
||||
// We might trigger a getter -> don't fail.
|
||||
let value;
|
||||
try {
|
||||
value = exports[exportName];
|
||||
|
||||
@@ -1537,7 +1537,7 @@ async function consumeSyncSource(handle, stream, source) {
|
||||
stream.destroy(err);
|
||||
} else {
|
||||
// If the stream is already destroyed, rethrow the error to avoid
|
||||
// silently swallowing it. Tho in practice this shouldn't happen.
|
||||
// silently swallowing it. Though in practice this shouldn't happen.
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -4984,7 +4984,7 @@ class QuicEndpoint {
|
||||
// As QuicSessions are closed they are expected to remove themselves
|
||||
// from the sessions collection. Just in case they don't, let's force
|
||||
// it by resetting the set so we don't leak memory. Let's emit a warning,
|
||||
// tho, if the set is not empty at this point as that would indicate a
|
||||
// though, if the set is not empty at this point as that would indicate a
|
||||
// bug in Node.js that should be fixed.
|
||||
if (inner.sessions.size > 0) {
|
||||
process.emitWarning(
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ class CppgcMixin : public cppgc::GarbageCollectedMixin, public MemoryRetainer {
|
||||
// during Realm shutdown. The destruction of the wrappers would happen later,
|
||||
// when the final garbage collection is triggered when CppHeap is torn down as
|
||||
// part of the Isolate teardown. If subclasses of CppgcMixin wish to perform
|
||||
// cleanups that depend on the Realm during destruction, they should implment
|
||||
// cleanups that depend on the Realm during destruction, they should implement
|
||||
// it in a Clean() override, and then call this->Finalize() from their
|
||||
// destructor. Outside of Finalize(), subclasses should avoid calling
|
||||
// into JavaScript or perform any operation that can trigger garbage
|
||||
|
||||
@@ -943,11 +943,11 @@ class FdEntry final : public EntryImpl {
|
||||
uv_fs_t req = uv_fs_t();
|
||||
auto cleanup = OnScopeLeave([&] { uv_fs_req_cleanup(&req); });
|
||||
// TODO(jasnell): Note the use of a sync fs call here is a bit unfortunate.
|
||||
// Doing this asynchronously creates a bit of a race condition tho, a file
|
||||
// could be unmodified when we call the operation but then by the time the
|
||||
// async callback is triggered to give us that answer the file is modified.
|
||||
// While such silliness is still possible here, the sync call at least makes
|
||||
// it less likely to hit the race.
|
||||
// Doing this asynchronously creates a bit of a race condition though, a
|
||||
// file could be unmodified when we call the operation but then by the time
|
||||
// the async callback is triggered to give us that answer the file is
|
||||
// modified. While such silliness is still possible here, the sync call at
|
||||
// least makes it less likely to hit the race.
|
||||
if (uv_fs_fstat(nullptr, &req, fd, nullptr) < 0) return true;
|
||||
return entry->is_modified(req.statbuf);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
|
||||
// TODO(@jasnell): Historically, this code has failed to correctly
|
||||
// propagate any error returned by the StringBytes::Encode method,
|
||||
// and would instead just crash the process. That behavior is preserved
|
||||
// here but should be looked at. Preferrably errors would be handled
|
||||
// here but should be looked at. Preferably errors would be handled
|
||||
// correctly here.
|
||||
TryCatch try_catch(env->isolate());
|
||||
MaybeLocal<Value> fn =
|
||||
|
||||
+1
-1
@@ -516,7 +516,7 @@ void ResetSignalHandlers() {
|
||||
// The only bad handler value we can inherit from before exec is SIG_IGN
|
||||
// (any actual function pointer is reset to SIG_DFL during exec).
|
||||
// If that's the case, we want to reset it back to SIG_DFL.
|
||||
// However, it's also possible that an embeder (or an LD_PRELOAD-ed
|
||||
// However, it's also possible that an embedder (or an LD_PRELOAD-ed
|
||||
// library) has set up own signal handler for own purposes
|
||||
// (e.g. profiling). If that's the case, we want to keep it intact.
|
||||
struct sigaction old;
|
||||
|
||||
+1
-1
@@ -461,7 +461,7 @@ void FileHandle::CloseReq::MemoryInfo(MemoryTracker* tracker) const {
|
||||
// Closes this FileHandle asynchronously and returns a Promise that will be
|
||||
// resolved when the callback is invoked, or rejects with a UVException if
|
||||
// there was a problem closing the fd. This is the preferred mechanism for
|
||||
// closing the FD object even tho the object will attempt to close
|
||||
// closing the FD object even though the object will attempt to close
|
||||
// automatically on gc.
|
||||
MaybeLocal<Promise> FileHandle::ClosePromise() {
|
||||
Isolate* isolate = env()->isolate();
|
||||
|
||||
+2
-2
@@ -778,7 +778,7 @@ void Http2Session::HasPendingData(const FunctionCallbackInfo<Value>& args) {
|
||||
bool Http2Session::HasPendingData() const {
|
||||
nghttp2_session* session = session_.get();
|
||||
int want_write = nghttp2_session_want_write(session);
|
||||
// It is expected that want_read will alway be 0 if graceful
|
||||
// It is expected that want_read will always be 0 if graceful
|
||||
// session close is initiated and goaway frame is sent.
|
||||
int want_read = nghttp2_session_want_read(session);
|
||||
if (want_write == 0 && want_read == 0) {
|
||||
@@ -948,7 +948,7 @@ ssize_t Http2Session::OnDWordAlignedPadding(size_t frameLen,
|
||||
size_t pad = frameLen + (8 - r);
|
||||
|
||||
// If maxPayloadLen happens to be less than the calculated pad length,
|
||||
// use the max instead, even tho this means the frame will not be
|
||||
// use the max instead, even though this means the frame will not be
|
||||
// aligned.
|
||||
pad = std::min(maxPayloadLen, pad);
|
||||
Debug(this, "using frame size padding: %d", pad);
|
||||
|
||||
@@ -233,7 +233,7 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
|
||||
// to it when the timer expires.
|
||||
TaskQueue<TaskQueueEntry>* pending_worker_tasks_;
|
||||
|
||||
// Locally scheduled tasks to be poped into the worker task runner queue.
|
||||
// Locally scheduled tasks to be popped into the worker task runner queue.
|
||||
// It is flushed whenever the next closest timer expires.
|
||||
TaskQueue<Task> tasks_;
|
||||
uv_loop_t loop_;
|
||||
|
||||
+1
-1
@@ -536,7 +536,7 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
|
||||
void set_priority_supported(bool on = true);
|
||||
|
||||
// Open a new locally-initialized stream with the specified directionality.
|
||||
// If the session is not yet in a state where the stream can be openen --
|
||||
// If the session is not yet in a state where the stream can be opened --
|
||||
// such as when the handshake is not yet sufficiently far along and ORTT
|
||||
// session resumption is not being used -- then the stream will be created
|
||||
// in a pending state where actually opening the stream will be deferred.
|
||||
|
||||
+2
-2
@@ -248,7 +248,7 @@ class Stream final : public AsyncWrap,
|
||||
~Stream() override;
|
||||
|
||||
// While the stream is still pending, the id will be kMaxStreamId,
|
||||
// inidicating the maximum possible stream id is kMaxStreamId - 1.
|
||||
// indicating the maximum possible stream id is kMaxStreamId - 1.
|
||||
stream_id id() const;
|
||||
|
||||
// While the stream is still pending, the origin will be invalid.
|
||||
@@ -315,7 +315,7 @@ class Stream final : public AsyncWrap,
|
||||
|
||||
// Called by the session/application to indicate that the specified number
|
||||
// of bytes have been transmitted to the peer. This is an initial
|
||||
// indication occuring the first time data is sent. It does not indicate
|
||||
// indication occurring the first time data is sent. It does not indicate
|
||||
// that the data has been retransmitted due to loss or has been
|
||||
// acknowledged to have been received by the peer.
|
||||
void Commit(size_t datalen, bool fin = false);
|
||||
|
||||
@@ -92,7 +92,8 @@ class ProcessMeta {
|
||||
// a conversion method so that the class can be used with both V8 legacy
|
||||
// trace API and perfetto API.
|
||||
//
|
||||
// These classes provide a JSON-inspired way to write structed data into traces.
|
||||
// These classes provide a JSON-inspired way to write structured data into
|
||||
// traces.
|
||||
//
|
||||
// To define how a custom class should be written into the trace, users should
|
||||
// define one of the two following functions:
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ function onGC(obj, gcListener) {
|
||||
|
||||
/**
|
||||
* Repeatedly triggers garbage collection until a specified condition is met or a maximum number of attempts is reached.
|
||||
* This utillity must be run in a Node.js instance that enables --expose-gc.
|
||||
* This utility must be run in a Node.js instance that enables --expose-gc.
|
||||
* @param {string|Function} [name] - Optional name, used in the rejection message if the condition is not met.
|
||||
* @param {Function} condition - A function that returns true when the desired condition is met.
|
||||
* @param {number} maxCount - Maximum number of garbage collections that should be tried.
|
||||
|
||||
@@ -31,7 +31,7 @@ const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' };
|
||||
const ANY = { IPv4: '0.0.0.0', IPv6: '::' };
|
||||
const FAM = 'IPv4';
|
||||
|
||||
// Windows wont bind on multicasts so its filtering is by port.
|
||||
// Windows won't bind on multicasts so its filtering is by port.
|
||||
const PORTS = {};
|
||||
for (let i = 0; i < MULTICASTS[FAM].length; i++) {
|
||||
PORTS[MULTICASTS[FAM][i]] = common.PORT + (common.isWindows ? i : 0);
|
||||
|
||||
@@ -46,8 +46,8 @@ function onResolve() {
|
||||
|
||||
|
||||
for (let i = 0; i < slowIOmax; i++) {
|
||||
// We need to refresh the domain string everytime,
|
||||
// otherwise the TCP stack that cache the previous lookup
|
||||
// We need to refresh the domain string every time,
|
||||
// otherwise the TCP stack that caches the previous lookup
|
||||
// returns result from memory, breaking all our Math.
|
||||
dns.lookup(`${randomDomain()}.com`, {}, common.mustCall(onResolve));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ process.on('warning', (e) => {
|
||||
lastWarning = e;
|
||||
});
|
||||
|
||||
// Utility promise for parts of the test that need to wait for eachother -
|
||||
// Utility promise for parts of the test that need to wait for each other -
|
||||
// Namely tests for warning events
|
||||
/* eslint-disable no-unused-vars */
|
||||
let asyncTest = Promise.resolve();
|
||||
|
||||
@@ -2705,7 +2705,7 @@ assert.strictEqual(
|
||||
);
|
||||
}
|
||||
|
||||
// Property getter throwing an error with getters that throws recursivly.
|
||||
// Property getter throwing an error with getters that throws recursively.
|
||||
{
|
||||
const recursivelyThrowingErrorDesc = {
|
||||
__proto__: null,
|
||||
|
||||
@@ -12,7 +12,7 @@ const assert = require('assert');
|
||||
const { inspect } = require('util');
|
||||
const vm = require('vm');
|
||||
|
||||
// The promise _synchronously_ resolves to undefined, because for a synthethic module,
|
||||
// The promise _synchronously_ resolves to undefined, because for a synthetic module,
|
||||
// the evaluation operation can only either resolve or reject immediately.
|
||||
// In this case, the asynchronously rejected promise can't be handled from the outside,
|
||||
// so we'll catch it with the isolate-level unhandledRejection handler.
|
||||
|
||||
Reference in new issue
Block a user