From bc38351d04e1174a035616681cb38dd89e2b7805 Mon Sep 17 00:00:00 2001 From: Erik Corry Date: Fri, 7 Feb 2025 14:55:23 +0100 Subject: [PATCH] Fix uses of it's vs its. (#3468) --- ...ement-cross-request-context-promise-resolve-hand.patch | 2 +- src/node/internal/internal_buffer.ts | 2 +- src/node/internal/internal_timers_promises.ts | 4 ++-- src/pyodide/internal/pool/builtin_wrappers.ts | 2 +- .../internal/topLevelEntropy/entropy_import_context.py | 2 +- src/workerd/api/node/tests/util-nodejs-test.js | 2 +- src/workerd/api/streams/README.md | 2 +- src/workerd/api/streams/common.h | 2 +- src/workerd/api/streams/internal.c++ | 2 +- src/workerd/api/streams/queue.c++ | 2 +- src/workerd/api/streams/readable.h | 2 +- src/workerd/api/streams/standard.c++ | 4 ++-- src/workerd/api/streams/standard.h | 2 +- src/workerd/api/tests/url-test.js | 2 +- src/workerd/api/url-standard.h | 2 +- src/workerd/api/worker-rpc.c++ | 8 ++++---- src/workerd/api/worker-rpc.h | 6 +++--- src/workerd/io/compatibility-date.capnp | 2 +- src/workerd/io/io-own.h | 2 +- src/workerd/io/worker.c++ | 4 ++-- src/workerd/jsg/jsg.h | 2 +- src/workerd/jsg/modules-new.h | 2 +- src/workerd/jsg/observer.h | 2 +- src/workerd/jsg/util.h | 2 +- src/workerd/server/server.c++ | 2 +- src/workerd/util/sqlite-kv.h | 2 +- 26 files changed, 34 insertions(+), 34 deletions(-) diff --git a/patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch b/patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch index bb0feaae623..7858fff042b 100644 --- a/patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch +++ b/patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch @@ -16,7 +16,7 @@ index 57db44234e2273476fe1cdcde31e1702bbabd61d..55af32087bdfa3fdee65ee3cfcc877ec + * PromiseCrossContextResolveCallback is called when resolving or rejecting a + * pending promise whose context tag is not strictly equal to the isolate's + * current promise context tag. The callback is called with the promise to be -+ * resolved, it's context tag, and a function that when called, causes the ++ * resolved, its context tag, and a function that when called, causes the + * reactions to the resolved promise to be enqueued. The idea is that the + * embedder sets this callback in the case it needs to defer the actual + * scheduling of the reactions to the given promise to a later time. diff --git a/src/node/internal/internal_buffer.ts b/src/node/internal/internal_buffer.ts index 0f368b4c7d1..ff8e6cdcfd4 100644 --- a/src/node/internal/internal_buffer.ts +++ b/src/node/internal/internal_buffer.ts @@ -55,7 +55,7 @@ float32Array[0] = -1; // 0xBF800000 // check this with `os.endianness()` because that is determined at compile time. export const bigEndian = uInt8Float32Array[3] === 0; -// Node.js caps it's max length at uint32_t max, we are very intentionally more +// Node.js caps its max length at uint32_t max, we are very intentionally more // conservative here, capping at int32_t max. export const kMaxLength = 2147483647; export const kStringMaxLength = 536870888; diff --git a/src/node/internal/internal_timers_promises.ts b/src/node/internal/internal_timers_promises.ts index 3b0839e28ca..ad35a3d894b 100644 --- a/src/node/internal/internal_timers_promises.ts +++ b/src/node/internal/internal_timers_promises.ts @@ -54,7 +54,7 @@ export async function setTimeout( validateAbortSignal(signal, 'options.signal'); } - // This is required due to consistency/compat reasons, even if it's no-op. + // This is required due to consistency/compat reasons, even if it's a no-op. if (ref !== undefined) { validateBoolean(ref, 'options.ref'); } @@ -97,7 +97,7 @@ export async function setImmediate( validateAbortSignal(signal, 'options.signal'); } - // This is required due to consistency/compat reasons, even if it's no-op. + // This is required due to consistency/compat reasons, even if it's a no-op. if (ref !== undefined) { validateBoolean(ref, 'options.ref'); } diff --git a/src/pyodide/internal/pool/builtin_wrappers.ts b/src/pyodide/internal/pool/builtin_wrappers.ts index 4ddefd635fd..5ab1c830e79 100644 --- a/src/pyodide/internal/pool/builtin_wrappers.ts +++ b/src/pyodide/internal/pool/builtin_wrappers.ts @@ -46,7 +46,7 @@ export function monotonicDateNow(): number { * * In particular, we specifically don't want to allow calls from places that * call arbitrary functions for the user like `JsvFunction_CallBound` or - * `raw_call_js`; if a user somehow gets there hands on a reference to + * `raw_call_js`; if a user somehow gets their hands on a reference to * `newWasmModule` and tries to call it from Python the call would come from one * of these places. Currently we only need to allow `convertJsFunctionToWasm` * but if we enable JSPI we'll need to whitelist a few more locations. diff --git a/src/pyodide/internal/topLevelEntropy/entropy_import_context.py b/src/pyodide/internal/topLevelEntropy/entropy_import_context.py index e9594beb146..5ce3910d870 100644 --- a/src/pyodide/internal/topLevelEntropy/entropy_import_context.py +++ b/src/pyodide/internal/topLevelEntropy/entropy_import_context.py @@ -96,7 +96,7 @@ def random_context(module): # Block calls to functions that use the bad random seed we produced from the # ten getentropy() calls. Instantiating Random with a given seed is fine, # instantiating it without a seed will call getentropy() and fail. - # Instantiating SystemRandom is fine, calling it's methods will call + # Instantiating SystemRandom is fine, calling its methods will call # getentropy() and fail. block_calls(module, allowlist=("Random", "SystemRandom")) diff --git a/src/workerd/api/node/tests/util-nodejs-test.js b/src/workerd/api/node/tests/util-nodejs-test.js index e4340dab016..de885ee05cd 100644 --- a/src/workerd/api/node/tests/util-nodejs-test.js +++ b/src/workerd/api/node/tests/util-nodejs-test.js @@ -3542,7 +3542,7 @@ export const utilInspectProxy = { }; proxyObj = new Proxy(target, handler); - // Inspecting the proxy should not actually walk it's properties + // Inspecting the proxy should not actually walk its properties util.inspect(proxyObj, opts); // Make sure inspecting object does not trigger any proxy traps. diff --git a/src/workerd/api/streams/README.md b/src/workerd/api/streams/README.md index 5662464e608..8287c720164 100644 --- a/src/workerd/api/streams/README.md +++ b/src/workerd/api/streams/README.md @@ -255,7 +255,7 @@ data in memory without any backpressure controls. In our implementation, we have modified the `tee()` method implementation to avoid this issue. -Each branch maintains it's own data buffer. But instead of those buffers containing a +Each branch maintains its own data buffer. But instead of those buffers containing a copy of the data, they contain a collection of refcounted references to the data. The backpressure signaling to the trunk is based on the branch wait the most unconsumed data in its buffer. diff --git a/src/workerd/api/streams/common.h b/src/workerd/api/streams/common.h index dfa59a14c0a..eb689198416 100644 --- a/src/workerd/api/streams/common.h +++ b/src/workerd/api/streams/common.h @@ -683,7 +683,7 @@ class WritableStreamController { // the only way to interact with the underlying sink. virtual kj::Maybe> removeSink(jsg::Lock& js) = 0; - // Detaches the WritableStreamController from it's underlying implementation, leaving the + // Detaches the WritableStreamController from its underlying implementation, leaving the // writable stream locked and in a state where no further writes can be made. virtual void detach(jsg::Lock& js) = 0; diff --git a/src/workerd/api/streams/internal.c++ b/src/workerd/api/streams/internal.c++ index cb77951ba37..86e53b516e4 100644 --- a/src/workerd/api/streams/internal.c++ +++ b/src/workerd/api/streams/internal.c++ @@ -143,7 +143,7 @@ class AllReader final { uint64_t amountToRead = kj::min(limit, kj::min(MAX_BUFFER_CHUNK, maybeLength.orDefault(DEFAULT_BUFFER_CHUNK))); // amountToRead can be zero if the stream reported a zero-length. While the stream could - // be lying about it's length, let's skip reading anything in this case. + // be lying about its length, let's skip reading anything in this case. if (amountToRead > 0) { for (;;) { auto bytes = kj::heapArray(amountToRead); diff --git a/src/workerd/api/streams/queue.c++ b/src/workerd/api/streams/queue.c++ index 54068a18e3d..ff84bf25297 100644 --- a/src/workerd/api/streams/queue.c++ +++ b/src/workerd/api/streams/queue.c++ @@ -498,7 +498,7 @@ bool ByteQueue::ByobRequest::respond(jsg::Lock& js, size_t amount) { bool ByteQueue::ByobRequest::respondWithNewView(jsg::Lock& js, jsg::BufferSource view) { // The idea here is that rather than filling the view that the controller was given, - // it chose to create it's own view and fill that, likely over the same ArrayBuffer. + // it chose to create its own view and fill that, likely over the same ArrayBuffer. // What we do here is perform some basic validations on what we were given, and if // those pass, we'll replace the backing store held in the req.pullInto with the one // given, then continue on issuing the respond as normal. diff --git a/src/workerd/api/streams/readable.h b/src/workerd/api/streams/readable.h index b4dab149c2a..87cf9f8f9c6 100644 --- a/src/workerd/api/streams/readable.h +++ b/src/workerd/api/streams/readable.h @@ -360,7 +360,7 @@ class ReadableStream: public jsg::Object { }); } - // Detaches this ReadableStream from it's underlying controller state, returning a + // Detaches this ReadableStream from its underlying controller state, returning a // new ReadableStream instance that takes over the underlying state. This is used to // support the "create a proxy" of a ReadableStream algorithm in the streams spec // (see https://streams.spec.whatwg.org/#readablestream-create-a-proxy). In that diff --git a/src/workerd/api/streams/standard.c++ b/src/workerd/api/streams/standard.c++ index 06713f3b4f7..9ac92de589d 100644 --- a/src/workerd/api/streams/standard.c++ +++ b/src/workerd/api/streams/standard.c++ @@ -932,7 +932,7 @@ jsg::Promise ReadableImpl::cancel( if (consumerCount > 1) { // If there is more than 1 consumer, then we just return here with an // immediately resolved promise. The consumer will remove itself, - // canceling it's interest in the underlying source but we do not yet + // canceling its interest in the underlying source but we do not yet // want to cancel the underlying source since there are still other // consumers that want data. return js.resolvedPromise(); @@ -3140,7 +3140,7 @@ kj::Promise> ReadableStreamJsController::pumpTo( disturbed = true; // This operation will leave the ReadableStream locked and disturbed. It will consume - // the stream until it either closed or errors. If the deferred proxy promise or it's + // the stream until it either closed or errors. If the deferred proxy promise or its // inner promise is dropped, the PumpToReader (and sink) will be dropped and the stream // will be canceled. If the PumpToReader is dropped while there is a pending write on // the sink, the pending write will be canceled. diff --git a/src/workerd/api/streams/standard.h b/src/workerd/api/streams/standard.h index d37f60b12f4..0d591c7da28 100644 --- a/src/workerd/api/streams/standard.h +++ b/src/workerd/api/streams/standard.h @@ -354,7 +354,7 @@ class WritableImpl { struct Writable {}; // Sadly, we have to use a weak ref here rather than jsg::Ref. This is because - // the jsg::Ref (via it's internal WritableStreamJsController) + // the jsg::Ref (via its internal WritableStreamJsController) // holds a strong reference to the jsg::Ref that // uses this WritableImpl. This creates a strong circular reference between jsg::Refs // that isn't allowed. GcTracing ends up with a stack overflow as the two jsg::Refs diff --git a/src/workerd/api/tests/url-test.js b/src/workerd/api/tests/url-test.js index a5003f42278..9af4e8de7c4 100644 --- a/src/workerd/api/tests/url-test.js +++ b/src/workerd/api/tests/url-test.js @@ -369,7 +369,7 @@ export const urlSearchParamsInit2 = { export const urlSearchParamsInit3 = { test() { - // If the initializer has a deleted iterator, then it's + // If the initializer has a deleted iterator, then its // contents are ignored but can still be interpreted as // a dictionary. const search1 = new URLSearchParams('a=b'); diff --git a/src/workerd/api/url-standard.h b/src/workerd/api/url-standard.h index 088e604978c..c9f2c939b2c 100644 --- a/src/workerd/api/url-standard.h +++ b/src/workerd/api/url-standard.h @@ -15,7 +15,7 @@ namespace workerd::api { // The original URL implementation based on kj::Url is not compliant with the // WHATWG URL standard, but we can't get rid of it. This is an alternate // implementation that is based on the spec. It can be enabled using a -// configuration flag. We put it in it's own namespace to keep it's classes +// configuration flag. We put it in its own namespace to keep its classes // from conflicting with the old implementation. namespace url { diff --git a/src/workerd/api/worker-rpc.c++ b/src/workerd/api/worker-rpc.c++ index 7714d86dbad..13cb9ca793e 100644 --- a/src/workerd/api/worker-rpc.c++ +++ b/src/workerd/api/worker-rpc.c++ @@ -432,7 +432,7 @@ rpc::JsRpcTarget::Client JsRpcProperty::getClientForOneCall( namespace { -struct JsRpcPromiseAndPipleine { +struct JsRpcPromiseAndPipeline { jsg::JsPromise promise; kj::Own weakRef; rpc::JsRpcTarget::CallResults::Pipeline pipeline; @@ -444,7 +444,7 @@ struct JsRpcPromiseAndPipleine { }; // Core implementation of making an RPC call, reusable for many cases below. -JsRpcPromiseAndPipleine callImpl(jsg::Lock& js, +JsRpcPromiseAndPipeline callImpl(jsg::Lock& js, JsRpcClientProvider& parent, kj::Maybe name, // If `maybeArgs` is provided, this is a call, otherwise it is a property access. @@ -467,7 +467,7 @@ JsRpcPromiseAndPipleine callImpl(jsg::Lock& js, // less convenient. try { - return js.tryCatch([&]() -> JsRpcPromiseAndPipleine { + return js.tryCatch([&]() -> JsRpcPromiseAndPipeline { // `path` will be filled in with the path of property names leading from the stub represented by // `client` to the specific property / method that we're trying to invoke. kj::Vector path; @@ -578,7 +578,7 @@ JsRpcPromiseAndPipleine callImpl(jsg::Lock& js, .weakRef = kj::mv(weakRef), .pipeline = kj::mv(callResult), }; - }, [&](jsg::Value error) -> JsRpcPromiseAndPipleine { + }, [&](jsg::Value error) -> JsRpcPromiseAndPipeline { // Probably a serialization error. Need to convert to an async error since we never throw // synchronously from async functions. auto jsError = jsg::JsValue(error.getHandle(js)); diff --git a/src/workerd/api/worker-rpc.h b/src/workerd/api/worker-rpc.h index 4aac2e768b1..6664012316f 100644 --- a/src/workerd/api/worker-rpc.h +++ b/src/workerd/api/worker-rpc.h @@ -30,7 +30,7 @@ namespace workerd::api { // separate calls. constexpr size_t MAX_JS_RPC_MESSAGE_SIZE = 1u << 20; -// ExternalHandler used when serializing RPC messages. Serialization functions which whish to +// ExternalHandler used when serializing RPC messages. Serialization functions with which to // handle RPC specially should use this. class RpcSerializerExternalHander final: public jsg::Serializer::ExternalHandler { public: @@ -81,7 +81,7 @@ class RpcSerializerExternalHander final: public jsg::Serializer::ExternalHandler class RpcStubDisposalGroup; class StreamSinkImpl; -// ExternalHandler used when deserializing RPC messages. Deserialization functions which whish to +// ExternalHandler used when deserializing RPC messages. Deserialization functions with which to // handle RPC specially should use this. class RpcDeserializerExternalHander final: public jsg::Deserializer::ExternalHandler { public: @@ -144,7 +144,7 @@ class JsRpcTarget: public jsg::Object { // Common superclass of JsRpcStub and Fetcher, the two types that may serve as the basis for // RPC calls. // -// This class is NOT part of the JavaScript class heirarchy (it has no JSG_RESOURCE_TYPE block), +// This class is NOT part of the JavaScript class hierarchy (it has no JSG_RESOURCE_TYPE block), // it's only a C++ class used to abstract how to get a capnp client out of the object. class JsRpcClientProvider: public jsg::Object { public: diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index b4a310495c2..214da69d352 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -156,7 +156,7 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef { $compatEnableDate("2022-01-31") $compatDisableFlag("workers_api_getters_setters_on_instance"); # Originally, JSG_PROPERTY registered getter/setters on an objects *instance* - # template as opposed to it's prototype template. This broke subclassing at + # template as opposed to its prototype template. This broke subclassing at # the JavaScript layer, preventing a subclass from correctly overriding the # superclasses getters/setters. This flag controls the breaking change made # to set those getters/setters on the prototype template instead. diff --git a/src/workerd/io/io-own.h b/src/workerd/io/io-own.h index cde31d5f5ae..7d0eb6090be 100644 --- a/src/workerd/io/io-own.h +++ b/src/workerd/io/io-own.h @@ -166,7 +166,7 @@ class DeleteQueue: public kj::AtomicRefcounted { friend class IoContext; }; -// Object which can push actions into a specific DeleteQueue then signal it's +// Object which can push actions into a specific DeleteQueue then signal its // owning IoContext to wake up to process the queue. This is a bit of a hack of // the DeleteQueue concept that allows us to use the same queue for more than // just deletions. diff --git a/src/workerd/io/worker.c++ b/src/workerd/io/worker.c++ index 967d5f69349..05f63a927de 100644 --- a/src/workerd/io/worker.c++ +++ b/src/workerd/io/worker.c++ @@ -1140,7 +1140,7 @@ Worker::Isolate::Isolate(kj::Own apiParam, // The PromiseCrossContextResolveCallback is used to ensure that promise reactions // are only scheduled on the microtask queue from the appropriate IoContext for the // promise. Huh? Yeah, that's not super clear... let me explain a bit more. - // Every request runs in it's own IoContext. + // Every request runs in its own IoContext. // Some I/O objects are bound to the IoContext when they are created. // If these objects are accessed from the wrong IoContext, things blow up. // If I create a promise in one request and pass the resolve/reject functions @@ -2208,7 +2208,7 @@ void Worker::Lock::validateHandlers(ValidationErrorReporter& errorReporter) { } for (auto& entry: worker.impl->statelessClasses) { // We want to report all of the stateless class's members. To do this, we examine its - // prototype, and it's prototype's prototype, and so on, until we get to Object's + // prototype, and its prototype's prototype, and so on, until we get to Object's // prototype, which we ignore. auto entrypointName = getEntrypointName(entry.key); js.withinHandleScope([&]() { diff --git a/src/workerd/jsg/jsg.h b/src/workerd/jsg/jsg.h index a84c63aaab2..8e60f8338a5 100644 --- a/src/workerd/jsg/jsg.h +++ b/src/workerd/jsg/jsg.h @@ -521,7 +521,7 @@ using HasGetTemplateOverload = static constexpr decltype(jsgSerializeTag) jsgSerializeOldTags[] = {}; \ static constexpr auto jsgSerializeOneway = true -// Declares a wildcart property getter. If a property is requested that isn't already present on +// Declares a wildcard property getter. If a property is requested that isn't already present on // the object or its prototypes, the wildcard property getter will be given a chance to return the // property. // diff --git a/src/workerd/jsg/modules-new.h b/src/workerd/jsg/modules-new.h index b9e2936c798..624598a7265 100644 --- a/src/workerd/jsg/modules-new.h +++ b/src/workerd/jsg/modules-new.h @@ -160,7 +160,7 @@ struct ResolveContext final { // The abstraction of a module within the ModuleRegistry. // Importantly, a Module is immutable once created and must be thread-safe. // The Module class itself represents the definition of a module and not -// it's actual instantiation. +// its actual instantiation. class Module { public: enum class Type : uint8_t { diff --git a/src/workerd/jsg/observer.h b/src/workerd/jsg/observer.h index 94142e69cb6..68558940751 100644 --- a/src/workerd/jsg/observer.h +++ b/src/workerd/jsg/observer.h @@ -29,7 +29,7 @@ struct ResolveObserver { // The resolve is being performed in the context of a builtin module // (that is, one of the modules built into the worker runtime). BUILTIN, - // Like builtin, the but it's a module that is *only* resolvable from a builtin + // Like builtin, but it's a module that is *only* resolvable from a builtin // (like the `node-internal:...` modules) BUILTIN_ONLY, }; diff --git a/src/workerd/jsg/util.h b/src/workerd/jsg/util.h index 77502763818..653ef06cfc0 100644 --- a/src/workerd/jsg/util.h +++ b/src/workerd/jsg/util.h @@ -213,7 +213,7 @@ v8::Local deepClone(v8::Local context, v8::Local v8::Local v8Str(v8::Isolate* isolate, kj::ArrayPtr ptr, diff --git a/src/workerd/server/server.c++ b/src/workerd/server/server.c++ index a95949650b9..fdc16417d54 100644 --- a/src/workerd/server/server.c++ +++ b/src/workerd/server/server.c++ @@ -1228,7 +1228,7 @@ kj::Own Server::makeDiskDirectoryService(kj::StringPtr name, // ======================================================================================= // This class exists to update the InspectorService's table of isolates when a config -// has multiple services. The InspectorService exists on the stack of it's own thread and +// has multiple services. The InspectorService exists on the stack of its own thread and // initializes state that is bound to the thread, e.g. a http server and an event loop. // This class provides a small thread-safe interface to the InspectorService so : // mappings can be added after the InspectorService has started. diff --git a/src/workerd/util/sqlite-kv.h b/src/workerd/util/sqlite-kv.h index 4173ebdda7b..5ee0d53c56f 100644 --- a/src/workerd/util/sqlite-kv.h +++ b/src/workerd/util/sqlite-kv.h @@ -39,7 +39,7 @@ class SqliteKv: private SqliteDatabase::ResetListener { enum Order { FORWARD, REVERSE }; - // Search for all knows keys and values in a range, calling the callback (with KeyPtr and + // Search for all known keys and values in a range, calling the callback (with KeyPtr and // ValuePtr parameters) for each one seen. `end` and `limit` can be null to request no constraint // be enforced. template