Skip to content

Commit bf7d7ae

Browse files
NathanBaulchtargos
authored andcommitted
lib: fix typos
PR-URL: #55065 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 73b05cf commit bf7d7ae

File tree

13 files changed

+30
-30
lines changed

13 files changed

+30
-30
lines changed

lib/internal/crypto/keys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'],
8888
encodingNames[m[0]] = m[1];
8989

9090
// Creating the KeyObject class is a little complicated due to inheritance
91-
// and the fact that KeyObjects should be transferrable between threads,
91+
// and the fact that KeyObjects should be transferable between threads,
9292
// which requires the KeyObject base class to be implemented in C++.
9393
// The creation requires a callback to make sure that the NativeKeyObject
9494
// base class cannot exist without the other KeyObject implementations.

lib/internal/crypto/webidl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function type(V) {
8080
case 'object': // Fall through
8181
case 'function': // Fall through
8282
default:
83-
// Per ES spec, typeof returns an implemention-defined value that is not
83+
// Per ES spec, typeof returns an implementation-defined value that is not
8484
// any of the existing ones for uncallable non-standard exotic objects.
8585
// Yet Type() which the Web IDL spec depends on returns Object for such
8686
// cases. So treat the default case as an object.

lib/internal/dns/utils.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const kSerializeResolver = Symbol('dns:resolver:serialize');
5959
const kDeserializeResolver = Symbol('dns:resolver:deserialize');
6060
const kSnapshotStates = Symbol('dns:resolver:config');
6161
const kInitializeHandle = Symbol('dns:resolver:initializeHandle');
62-
const kSetServersInteral = Symbol('dns:resolver:setServers');
62+
const kSetServersInternal = Symbol('dns:resolver:setServers');
6363

6464
// Resolver instances correspond 1:1 to c-ares channels.
6565

@@ -139,10 +139,10 @@ class ResolverBase {
139139
throw new ERR_INVALID_IP_ADDRESS(serv);
140140
});
141141

142-
this[kSetServersInteral](newSet, servers);
142+
this[kSetServersInternal](newSet, servers);
143143
}
144144

145-
[kSetServersInteral](newSet, servers) {
145+
[kSetServersInternal](newSet, servers) {
146146
const orig = ArrayPrototypeMap(this._handle.getServers() || [], (val) => {
147147
val.unshift(isIP(val[0]));
148148
return val;
@@ -194,7 +194,7 @@ class ResolverBase {
194194
this._handle.setLocalAddress(ipv4, ipv6);
195195
}
196196
if (servers) {
197-
this[kSetServersInteral](servers, servers);
197+
this[kSetServersInternal](servers, servers);
198198
}
199199
}
200200
}

lib/internal/fs/glob.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ class Glob {
337337
const subPatterns = new SafeSet();
338338
const nSymlinks = new SafeSet();
339339
for (const index of pattern.indexes) {
340-
// For each child, chek potential patterns
340+
// For each child, check potential patterns
341341
if (this.#cache.seen(entryPath, pattern, index) || this.#cache.seen(entryPath, pattern, index + 1)) {
342342
return;
343343
}
@@ -365,7 +365,7 @@ class Glob {
365365
// If next pattern is the last one, add to results
366366
this.#results.add(entryPath);
367367
} else if (nextMatches && entry.isDirectory()) {
368-
// Pattern mached, meaning two patterns forward
368+
// Pattern matched, meaning two patterns forward
369369
// are also potential patterns
370370
// e.g **/b/c when entry is a/b - add c to potential patterns
371371
subPatterns.add(index + 2);
@@ -532,7 +532,7 @@ class Glob {
532532
const subPatterns = new SafeSet();
533533
const nSymlinks = new SafeSet();
534534
for (const index of pattern.indexes) {
535-
// For each child, chek potential patterns
535+
// For each child, check potential patterns
536536
if (this.#cache.seen(entryPath, pattern, index) || this.#cache.seen(entryPath, pattern, index + 1)) {
537537
return;
538538
}
@@ -566,7 +566,7 @@ class Glob {
566566
yield this.#withFileTypes ? entry : entryPath;
567567
}
568568
} else if (nextMatches && entry.isDirectory()) {
569-
// Pattern mached, meaning two patterns forward
569+
// Pattern matched, meaning two patterns forward
570570
// are also potential patterns
571571
// e.g **/b/c when entry is a/b - add c to potential patterns
572572
subPatterns.add(index + 2);

lib/internal/modules/esm/fetch_module.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ const cacheForGET = new SafeMap();
4141
// [1] The V8 snapshot doesn't like some C++ APIs to be loaded eagerly. Do it
4242
// lazily/at runtime and not top level of an internal module.
4343

44-
// [2] Creating a new agent instead of using the gloabl agent improves
44+
// [2] Creating a new agent instead of using the global agent improves
4545
// performance and precludes the agent becoming tainted.
4646

4747
/** @type {import('https').Agent} The Cached HTTP Agent for **secure** HTTP requests. */
4848
let HTTPSAgent;
4949
/**
5050
* Make a HTTPs GET request (handling agent setup if needed, caching the agent to avoid
51-
* redudant instantiations).
51+
* redundant instantiations).
5252
* @param {Parameters<import('https').get>[0]} input - The URI to fetch.
5353
* @param {Parameters<import('https').get>[1]} options - See https.get() options.
5454
*/
@@ -67,7 +67,7 @@ function HTTPSGet(input, options) {
6767
let HTTPAgent;
6868
/**
6969
* Make a HTTP GET request (handling agent setup if needed, caching the agent to avoid
70-
* redudant instantiations).
70+
* redundant instantiations).
7171
* @param {Parameters<import('http').get>[0]} input - The URI to fetch.
7272
* @param {Parameters<import('http').get>[1]} options - See http.get() options.
7373
*/

lib/internal/modules/esm/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class ModuleLoader {
415415
/**
416416
* Translate a loaded module source into a ModuleWrap. This is run synchronously,
417417
* but the translator may return the ModuleWrap in a Promise.
418-
* @param {stirng} url URL of the module to be translated.
418+
* @param {string} url URL of the module to be translated.
419419
* @param {string} format Format of the module to be translated. This is used to find
420420
* matching translators.
421421
* @param {ModuleSource} source Source of the module to be translated.

lib/internal/process/finalization.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function createFinalization() {
6464
const fn = ref.fn;
6565

6666
// This should always happen, however GC is
67-
// undeterministic so it might not happen.
67+
// indeterministic so it might not happen.
6868
/* istanbul ignore else */
6969
if (obj !== undefined) {
7070
fn(obj, event);

lib/internal/source_map/source_map_cache_map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const {
2626
* Obsolete `weakModuleMap` entries are removed by the `finalizationRegistry`
2727
* callback. This pattern decouples the strong url reference to the source map
2828
* data and allow the cache to be reclaimed eagerly, without depending on an
29-
* undeterministic callback of a finalization registry.
29+
* indeterministic callback of a finalization registry.
3030
*/
3131
class SourceMapCacheMap {
3232
/**

lib/internal/test_runner/mock/mock_timers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class MockTimers {
377377
return FunctionPrototypeToString(MockDate[kMock].#nativeDateDescriptor.value);
378378
};
379379

380-
// We need to polute the prototype of this
380+
// We need to pollute the prototype of this
381381
ObjectDefineProperties(MockDate, {
382382
__proto__: null,
383383
[kMock]: {

lib/internal/test_runner/reporter/v8-serializer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = async function* v8Reporter(source) {
1616
for await (const item of source) {
1717
const originalError = item.data.details?.error;
1818
if (originalError) {
19-
// Error is overriden with a serialized version, so that it can be
19+
// Error is overridden with a serialized version, so that it can be
2020
// deserialized in the parent process.
2121
// Error is restored after serialization.
2222
item.data.details.error = serializeError(originalError);

lib/internal/test_runner/runner.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class FileTest extends Test {
275275
ArrayPrototypePush(this.#rawBuffer, readData);
276276
}
277277
this.#rawBufferSize += dataLength;
278-
this.#proccessRawBuffer();
278+
this.#processRawBuffer();
279279

280280
if (partialV8Header) {
281281
ArrayPrototypePush(this.#rawBuffer, TypedArrayPrototypeSubarray(v8Header, 0, 1));
@@ -284,10 +284,10 @@ class FileTest extends Test {
284284
}
285285
#drainRawBuffer() {
286286
while (this.#rawBuffer.length > 0) {
287-
this.#proccessRawBuffer();
287+
this.#processRawBuffer();
288288
}
289289
}
290-
#proccessRawBuffer() {
290+
#processRawBuffer() {
291291
// This method is called when it is known that there is at least one message
292292
let bufferHead = this.#rawBuffer[0];
293293
let headerIndex = bufferHead.indexOf(v8Header);

lib/internal/util.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,9 @@ function SideEffectFreeRegExpPrototypeExec(regex, string) {
768768
return FunctionPrototypeCall(RegExpFromAnotherRealm.prototype.exec, regex, string);
769769
}
770770

771-
const crossRelmRegexes = new SafeWeakMap();
772-
function getCrossRelmRegex(regex) {
773-
const cached = crossRelmRegexes.get(regex);
771+
const crossRealmRegexes = new SafeWeakMap();
772+
function getCrossRealmRegex(regex) {
773+
const cached = crossRealmRegexes.get(regex);
774774
if (cached) return cached;
775775

776776
let flagString = '';
@@ -783,17 +783,17 @@ function getCrossRelmRegex(regex) {
783783
if (RegExpPrototypeGetSticky(regex)) flagString += 'y';
784784

785785
const { RegExp: RegExpFromAnotherRealm } = getInternalGlobal();
786-
const crossRelmRegex = new RegExpFromAnotherRealm(RegExpPrototypeGetSource(regex), flagString);
787-
crossRelmRegexes.set(regex, crossRelmRegex);
788-
return crossRelmRegex;
786+
const crossRealmRegex = new RegExpFromAnotherRealm(RegExpPrototypeGetSource(regex), flagString);
787+
crossRealmRegexes.set(regex, crossRealmRegex);
788+
return crossRealmRegex;
789789
}
790790

791791
function SideEffectFreeRegExpPrototypeSymbolReplace(regex, string, replacement) {
792-
return getCrossRelmRegex(regex)[SymbolReplace](string, replacement);
792+
return getCrossRealmRegex(regex)[SymbolReplace](string, replacement);
793793
}
794794

795795
function SideEffectFreeRegExpPrototypeSymbolSplit(regex, string, limit = undefined) {
796-
return getCrossRelmRegex(regex)[SymbolSplit](string, limit);
796+
return getCrossRealmRegex(regex)[SymbolSplit](string, limit);
797797
}
798798

799799
/**

lib/internal/webidl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ function type(V) {
241241
case 'object': // Fall through
242242
case 'function': // Fall through
243243
default:
244-
// Per ES spec, typeof returns an implemention-defined value that is not
244+
// Per ES spec, typeof returns an implementation-defined value that is not
245245
// any of the existing ones for uncallable non-standard exotic objects.
246246
// Yet Type() which the Web IDL spec depends on returns Object for such
247247
// cases. So treat the default case as an object.

0 commit comments

Comments
 (0)