From 9448c561d030c7a71dffc079e539a2527736de8d Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Sun, 5 Nov 2023 14:55:05 +0000 Subject: [PATCH] Fix a few spellos The majority of these are in comments. --- src/node/internal/crypto_keys.ts | 2 +- src/workerd/api/node/buffer.c++ | 2 +- src/workerd/api/node/diagnostics-channel.c++ | 2 +- src/workerd/jsg/README.md | 2 +- src/workerd/jsg/async-context.h | 2 +- src/workerd/jsg/dom-exception.h | 2 +- src/workerd/jsg/exception.c++ | 8 ++++---- src/workerd/jsg/exception.h | 4 ++-- src/workerd/jsg/function.h | 6 +++--- src/workerd/jsg/jsg.c++ | 2 +- src/workerd/jsg/jsg.h | 16 ++++++++-------- src/workerd/jsg/jsvalue.h | 2 +- src/workerd/jsg/promise-test.c++ | 2 +- src/workerd/jsg/promise.h | 6 +++--- src/workerd/jsg/resource.h | 2 +- src/workerd/jsg/ser.c++ | 12 ++++++------ src/workerd/jsg/ser.h | 6 +++--- src/workerd/jsg/string.h | 2 +- src/workerd/jsg/type-wrapper.h | 2 +- src/workerd/jsg/util.h | 6 +++--- src/workerd/jsg/value.h | 8 ++++---- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/node/internal/crypto_keys.ts b/src/node/internal/crypto_keys.ts index 9c11a6c0984..f970d69e272 100644 --- a/src/node/internal/crypto_keys.ts +++ b/src/node/internal/crypto_keys.ts @@ -77,7 +77,7 @@ import { } from 'node-internal:validators'; // In Node.js, the definition of KeyObject is a bit complicated because -// KeyObject instances in Node.js can be transfered via postMessage() and +// KeyObject instances in Node.js can be transferred via postMessage() and // structuredClone(), etc, allowing instances to be shared across multiple // worker threads. We do not implement that model so we're esssentially // re-implementing the Node.js API here instead of just taking their code. diff --git a/src/workerd/api/node/buffer.c++ b/src/workerd/api/node/buffer.c++ index b7e6ecb87f7..0e3d141729e 100644 --- a/src/workerd/api/node/buffer.c++ +++ b/src/workerd/api/node/buffer.c++ @@ -173,7 +173,7 @@ uint32_t writeInto( if (dest.size() == 0 || string.length(js) == 0) { return 0; } static constexpr jsg::JsString::WriteOptions flags = static_cast( - jsg::JsString::MANY_WRITES_EXPETED | + jsg::JsString::MANY_WRITES_EXPECTED | jsg::JsString::NO_NULL_TERMINATION | jsg::JsString::REPLACE_INVALID_UTF8); diff --git a/src/workerd/api/node/diagnostics-channel.c++ b/src/workerd/api/node/diagnostics-channel.c++ index 8447bf600d7..e565e4c9518 100644 --- a/src/workerd/api/node/diagnostics-channel.c++ +++ b/src/workerd/api/node/diagnostics-channel.c++ @@ -30,7 +30,7 @@ void Channel::publish(jsg::Lock& js, jsg::Value message) { ser.write(js, jsg::JsValue(message.getHandle(js))); auto tmp = ser.release(); JSG_REQUIRE(tmp.sharedArrayBuffers.size() == 0 && - tmp.transferedArrayBuffers.size() == 0, Error, + tmp.transferredArrayBuffers.size() == 0, Error, "Diagnostic events cannot be published with SharedArrayBuffer or " "transferred ArrayBuffer instances"); tracer.addDiagnosticChannelEvent(context.now(), name.toString(js), kj::mv(tmp.data)); diff --git a/src/workerd/jsg/README.md b/src/workerd/jsg/README.md index ed3ec981258..13882d9048b 100644 --- a/src/workerd/jsg/README.md +++ b/src/workerd/jsg/README.md @@ -45,7 +45,7 @@ public: // ... } - CFJS_RESOURCE_TYPE(Foo) { + JSG_RESOURCE_TYPE(Foo) { JSG_METHOD(foo); } }; diff --git a/src/workerd/jsg/async-context.h b/src/workerd/jsg/async-context.h index e216443a3af..d0bc4ca7bda 100644 --- a/src/workerd/jsg/async-context.h +++ b/src/workerd/jsg/async-context.h @@ -45,7 +45,7 @@ namespace workerd::jsg { // // To implement all of this, however, we depend largely on an obscure v8 API on the // v8::Context object called SetContinuationPreservedEmbedderData and -// GetContinuationPreservedEmbedderData. An AsyncContextFrame is a Wrappables because +// GetContinuationPreservedEmbedderData. An AsyncContextFrame is a Wrappable because // because instances of AsyncContextFrame are set as the continuation-preserved embedder // data and that API requires a JS value. // diff --git a/src/workerd/jsg/dom-exception.h b/src/workerd/jsg/dom-exception.h index 5bb219d729b..26e6a41680f 100644 --- a/src/workerd/jsg/dom-exception.h +++ b/src/workerd/jsg/dom-exception.h @@ -45,7 +45,7 @@ namespace workerd::jsg { // throw, per Web IDL. // // Users of JSG are free (and encouraged) to use this implementation, but they can also opt into -// the same tunneled exception feature by defining their own globally-accesible type named +// the same tunneled exception feature by defining their own globally-accessible type named // "DOMException". class DOMException: public Object { public: diff --git a/src/workerd/jsg/exception.c++ b/src/workerd/jsg/exception.c++ index 8b4be871fb8..c4a3c5a4474 100644 --- a/src/workerd/jsg/exception.c++ +++ b/src/workerd/jsg/exception.c++ @@ -49,7 +49,7 @@ TunneledErrorType tunneledErrorType(kj::StringPtr internalMessage) { Properties properties; // Remove `remote.` (if present). Note that there are cases where we return a tunneled error - // through multiple workers, so let's be paranoid and allow for multiple "remote." prefxies. + // through multiple workers, so let's be paranoid and allow for multiple "remote." prefixes. while (internalMessage.startsWith(ERROR_REMOTE_PREFIX)) { properties.isFromRemote = true; internalMessage = internalMessage.slice(ERROR_REMOTE_PREFIX.size()); @@ -156,10 +156,10 @@ bool isDoNotLogException(kj::StringPtr internalMessage) { return strstr(internalMessage.cStr(), "worker_do_not_log") != nullptr; } -kj::String annotateBroken(kj::StringPtr internalMessage, kj::StringPtr brokenessReason) { +kj::String annotateBroken(kj::StringPtr internalMessage, kj::StringPtr brokennessReason) { // TODO(soon) Once we support multiple brokenness reasons, we can make this much simpler. - KJ_LOG(INFO, "Annotating with brokenness", internalMessage, brokenessReason); + KJ_LOG(INFO, "Annotating with brokenness", internalMessage, brokennessReason); auto tunneledInfo = tunneledErrorType(internalMessage); kj::StringPtr remotePrefix; @@ -178,7 +178,7 @@ kj::String annotateBroken(kj::StringPtr internalMessage, kj::StringPtr brokeness } return kj::str( - remotePrefix, brokenessReason, ERROR_PREFIX_DELIM, prefixType, internalErrorType, + remotePrefix, brokennessReason, ERROR_PREFIX_DELIM, prefixType, internalErrorType, tunneledInfo.message); } diff --git a/src/workerd/jsg/exception.h b/src/workerd/jsg/exception.h index e99469d480f..2389c2b40eb 100644 --- a/src/workerd/jsg/exception.h +++ b/src/workerd/jsg/exception.h @@ -142,7 +142,7 @@ struct TunneledErrorType { TunneledErrorType tunneledErrorType(kj::StringPtr internalMessage); -// Annotate an internal message with the corresponding brokeness reason. -kj::String annotateBroken(kj::StringPtr internalMessage, kj::StringPtr brokenessReason); +// Annotate an internal message with the corresponding brokenness reason. +kj::String annotateBroken(kj::StringPtr internalMessage, kj::StringPtr brokennessReason); } // namespace workerd::jsg diff --git a/src/workerd/jsg/function.h b/src/workerd/jsg/function.h index 2013797cd65..d3f26070235 100644 --- a/src/workerd/jsg/function.h +++ b/src/workerd/jsg/function.h @@ -167,7 +167,7 @@ class Function { __builtin_unreachable(); } - // Get a handle to the underlying function. If this is a native funciton, + // Get a handle to the underlying function. If this is a native function, // `makeNativeWrapper(Ref&)` is called to create the wrapper. // // Only the `FunctionWrapper` TypeWrapper mixin should call this. Anyone else needs to call @@ -299,7 +299,7 @@ class FunctionWrapper { // Apparently, this function has been wrapped before and already has an opaque handle. // That's interesting. However, unfortunately, we don't have a handle to the v8::Function // that was created last time, so we can't return the same function instance. This is - // arguably incorrect; what if the application added properties to it or somtehing? + // arguably incorrect; what if the application added properties to it or something? // // Unfortunately, it is exceedingly difficult for us to store the function handle for // reuse without introducing performance problems. @@ -314,7 +314,7 @@ class FunctionWrapper { // - Another approach might be to store the v8::Function on the WrappableFunction, once // it's created. This is a cyclic reference, but we could rely on GC visitation to // collect it. The problem is, cyclic references can only be collected by tracing, not - // by scavenging. Tracing runs much less often than scavenging. So we'd be forcingc every + // by scavenging. Tracing runs much less often than scavenging. So we'd be forcing every // function object to live on the heap longer than otherwise necessary. // // In practice, it probably never matters that returning the same jsg::Function twice diff --git a/src/workerd/jsg/jsg.c++ b/src/workerd/jsg/jsg.c++ index 0daab38e36e..76f03d001f2 100644 --- a/src/workerd/jsg/jsg.c++ +++ b/src/workerd/jsg/jsg.c++ @@ -44,7 +44,7 @@ void Data::destroy() { handle.Reset(); // If we have a TracedReference, Reset() it too, to let V8 know that this value is no longer - // used. Note that merely detroying the TracedReference does nothing -- only explicitly + // used. Note that merely destroying the TracedReference does nothing -- only explicitly // calling Reset() has an effect. // // In particular, this permits `Data` values to be collected by minor (non-tracing) GC, as diff --git a/src/workerd/jsg/jsg.h b/src/workerd/jsg/jsg.h index 2b480f6e36e..9ab82011812 100644 --- a/src/workerd/jsg/jsg.h +++ b/src/workerd/jsg/jsg.h @@ -249,7 +249,7 @@ namespace workerd::jsg { // WARNING: This is usually not what you want. Usually you want JSG_PROTOTYPE_PROPERTY instead. // Note that V8 implements instance properties by modifying the instance immediately after // construction, which is inefficient and can break some optimizations. For example, any object -// with an instance proprety will not be possible to collect during minor GCs, only major GCs. +// with an instance property will not be possible to collect during minor GCs, only major GCs. // Prototype properties are on the prototype, so have no runtime overhead until they are used. #define JSG_INSTANCE_PROPERTY(name, getter, setter) \ do { \ @@ -639,7 +639,7 @@ class Lock; // // Move construction and move assignment of strong jsg::Data is well-defined even without // holding the isolate lock. That is, it is safe to move Values unless you have implemented GC -// visitation for them. Moving jsg::Data which are reachable via GC vistation is undefined +// visitation for them. Moving jsg::Data which are reachable via GC visitation is undefined // behavior outside of an isolate lock. class Data { public: @@ -1033,7 +1033,7 @@ class Object: private Wrappable { // // Move construction and move assignment of strong jsg::Refs is well-defined even without // holding the isolate lock. That is, it is safe to move Refs unless you have implemented GC -// visitation for them. Moving jsg::Refs which are reachable via GC vistation is undefined +// visitation for them. Moving jsg::Refs which are reachable via GC visitation is undefined // behavior outside of an isolate lock. template class Ref { @@ -1236,7 +1236,7 @@ class Name final { // Since the function could be backed by JavaScript, when calling it, you must always pass // `jsg::Lock&` as the first parameter. When implementing a `jsg::Function` using a C++ lambda, // the lambda should similarly take `jsg::Lock&` as the first parameter. Note that this first -// parameter is not declared in the function's signature. For exmaple, `jsg::Function` +// parameter is not declared in the function's signature. For example, `jsg::Function` // declares a function that accepts a parameter of type int and returns an int. However, when // actually calling it, you must still pass `jsg::Lock&`, with the `int` as the second parameter. // (Of course, from the JavaScript side, the lock parameter is hidden, and the `int` is in fact @@ -1291,7 +1291,7 @@ class Constructor; // `.catch_()` and two-argument `.then()` are supported. Thrown exceptions are represented using // `jsg::Value`, since technically JavaScript allows throwing any type. // -// The type T does not have to be convertable to/from JavaScript unless a Promise is actually +// The type T does not have to be convertible to/from JavaScript unless a Promise is actually // passed to/from JavaScript. That is, you can have an intermediate Promise where U is a type // that has no JavaScript representation. What actually happens is, when a Promise is passed // from JS into C++, JSG adds a .then() which unwraps the value T, and when a Promise is @@ -1641,10 +1641,10 @@ class TypeHandler { template class PropertyReflection { public: - // Read the property of this object called `name`, unwraping it as type `T`. + // Read the property of this object called `name`, unwrapping it as type `T`. kj::Maybe get(Lock& js, kj::StringPtr name); - // Read the property of this object called `name`, unwraping it as type `T`. + // Read the property of this object called `name`, unwrapping it as type `T`. kj::Maybe get(v8::Isolate* isolate, kj::StringPtr name) { v8::HandleScope scope(isolate); KJ_IF_SOME(s, self) { @@ -1943,7 +1943,7 @@ class Lock { // assumed to be serious enough that they cannot be caught as if they were JavaScript errors, // and instead unwind must continue until C++ catches them. // - // func() and errorHandler() must return the same type; the value they return will be retuned + // func() and errorHandler() must return the same type; the value they return will be returned // from `tryCatch()` itself. template auto tryCatch(Func&& func, ErrorHandler&& errorHandler) -> decltype(func()) { diff --git a/src/workerd/jsg/jsvalue.h b/src/workerd/jsg/jsvalue.h index ba6b9bbaf7e..94b6a31bd74 100644 --- a/src/workerd/jsg/jsvalue.h +++ b/src/workerd/jsg/jsvalue.h @@ -223,7 +223,7 @@ class JsString final : public JsBase { enum WriteOptions { NONE = v8::String::NO_OPTIONS, - MANY_WRITES_EXPETED = v8::String::HINT_MANY_WRITES_EXPECTED, + MANY_WRITES_EXPECTED = v8::String::HINT_MANY_WRITES_EXPECTED, NO_NULL_TERMINATION = v8::String::NO_NULL_TERMINATION, PRESERVE_ONE_BYTE_NULL = v8::String::PRESERVE_ONE_BYTE_NULL, REPLACE_INVALID_UTF8 = v8::String::REPLACE_INVALID_UTF8, diff --git a/src/workerd/jsg/promise-test.c++ b/src/workerd/jsg/promise-test.c++ index d5c70007af8..c6dd36f8e2a 100644 --- a/src/workerd/jsg/promise-test.c++ +++ b/src/workerd/jsg/promise-test.c++ @@ -27,7 +27,7 @@ struct PromiseContext: public jsg::Object, public jsg::ContextGlobal { } void setResult(jsg::Lock& js, Promise promise) { - // Throwing away the result of `.then()` dosen't cancel it! + // Throwing away the result of `.then()` doesn't cancel it! promise.then(js, [](jsg::Lock&, kj::String str) { promiseTestResult = str.parseAs(); }).then(js, [](jsg::Lock&) { diff --git a/src/workerd/jsg/promise.h b/src/workerd/jsg/promise.h index d65ffdcf557..244db852da8 100644 --- a/src/workerd/jsg/promise.h +++ b/src/workerd/jsg/promise.h @@ -135,7 +135,7 @@ struct ThenCatchPair { // FunctionCallback implementing a C++ .then() continuation on a JS promise. // // We expect the input is already an opaque-wrapped value, args.Data() is an opaque-wrapped C++ -// function to eoxecute, and we want to produce an opaque-wrapped output or Promise. +// function to execute, and we want to produce an opaque-wrapped output or Promise. template void promiseContinuation(const v8::FunctionCallbackInfo& args) { liftKj(args, [&]() { @@ -392,7 +392,7 @@ class Promise { // DEPRECATED: The versions below do not take a `Lock` as the first param, but they do actually // require a lock. These versions also do not pass a `Lock` to the callback. - // TODO(clenaup): Update all call sites to the version that passes locks. Then, remove these and + // TODO(cleanup): Update all call sites to the version that passes locks. Then, remove these and // also remove the `isolate` parameter from this class. template @@ -691,7 +691,7 @@ class PromiseWrapper { // It's possible to argue that we should actually allow only `undefined` here but // changing it now could break existing users, e.g. html-rewriter.ew-test is broken // because it writes `() => someExpression()` for a callback that's supposed to - // optionally return Promise -- it seems like the callback isn't acutally intending + // optionally return Promise -- it seems like the callback isn't actually intending // to return the result of `someExpression()` but does so by accident since the braces // are missing. This is probably common in user code, too. return resolvedPromise(context->GetIsolate()); diff --git a/src/workerd/jsg/resource.h b/src/workerd/jsg/resource.h index 64c59008061..37d2c71b559 100644 --- a/src/workerd/jsg/resource.h +++ b/src/workerd/jsg/resource.h @@ -564,7 +564,7 @@ class NullConfiguration { }; // TypeWrapper must list this type as its first superclass. The ResourceWrappers that it -// subclasses will then be able to regsiter themselves in the map. +// subclasses will then be able to register themselves in the map. template class DynamicResourceTypeMap { private: diff --git a/src/workerd/jsg/ser.c++ b/src/workerd/jsg/ser.c++ index a8af9014396..eeff817d3d3 100644 --- a/src/workerd/jsg/ser.c++ +++ b/src/workerd/jsg/ser.c++ @@ -52,7 +52,7 @@ Serializer::Released Serializer::release() { return Released { .data = kj::Array(pair.first, pair.second, jsg::SERIALIZED_BUFFER_DISPOSER), .sharedArrayBuffers = sharedBackingStores.releaseAsArray(), - .transferedArrayBuffers = backingStores.releaseAsArray(), + .transferredArrayBuffers = backingStores.releaseAsArray(), }; } @@ -91,7 +91,7 @@ void Serializer::write(Lock& js, const JsValue& value) { Deserializer::Deserializer( Lock& js, kj::ArrayPtr data, - kj::Maybe>> transferedArrayBuffers, + kj::Maybe>> transferredArrayBuffers, kj::Maybe>> sharedArrayBuffers, kj::Maybe maybeOptions) : deser(js.v8Isolate, data.begin(), data.size(), this), @@ -99,7 +99,7 @@ Deserializer::Deserializer( #ifdef KJ_DEBUG kj::requireOnStack(this, "jsg::Deserializer must be allocated on the stack"); #endif - init(js, kj::mv(transferedArrayBuffers), kj::mv(maybeOptions)); + init(js, kj::mv(transferredArrayBuffers), kj::mv(maybeOptions)); } Deserializer::Deserializer( @@ -109,13 +109,13 @@ Deserializer::Deserializer( : Deserializer( js, released.data.asPtr(), - released.transferedArrayBuffers.asPtr(), + released.transferredArrayBuffers.asPtr(), released.sharedArrayBuffers.asPtr(), kj::mv(maybeOptions)) {} void Deserializer::init( Lock& js, - kj::Maybe>> transferedArrayBuffers, + kj::Maybe>> transferredArrayBuffers, kj::Maybe maybeOptions) { auto options = maybeOptions.orDefault({}); if (options.readHeader) { @@ -125,7 +125,7 @@ void Deserializer::init( KJ_ASSERT(version >= 13, "The minimum serialization version is 13."); deser.SetWireFormatVersion(version); } - KJ_IF_SOME(arrayBuffers, transferedArrayBuffers) { + KJ_IF_SOME(arrayBuffers, transferredArrayBuffers) { for (auto n : kj::indices(arrayBuffers)) { deser.TransferArrayBuffer(n, v8::ArrayBuffer::New(js.v8Isolate, kj::mv((arrayBuffers)[n]))); diff --git a/src/workerd/jsg/ser.h b/src/workerd/jsg/ser.h index 612067cf47b..39a2a653a10 100644 --- a/src/workerd/jsg/ser.h +++ b/src/workerd/jsg/ser.h @@ -25,7 +25,7 @@ class Serializer final: v8::ValueSerializer::Delegate { struct Released { kj::Array data; kj::Array> sharedArrayBuffers; - kj::Array> transferedArrayBuffers; + kj::Array> transferredArrayBuffers; }; explicit Serializer(Lock& js, kj::Maybe maybeOptions = kj::none); @@ -68,7 +68,7 @@ class Deserializer final: v8::ValueDeserializer::Delegate { explicit Deserializer( Lock& js, kj::ArrayPtr data, - kj::Maybe>> transferedArrayBuffers = kj::none, + kj::Maybe>> transferredArrayBuffers = kj::none, kj::Maybe>> sharedArrayBuffers = kj::none, kj::Maybe maybeOptions = kj::none); @@ -88,7 +88,7 @@ class Deserializer final: v8::ValueDeserializer::Delegate { private: void init( Lock& js, - kj::Maybe>> transferedArrayBuffers = kj::none, + kj::Maybe>> transferredArrayBuffers = kj::none, kj::Maybe maybeOptions = kj::none); v8::MaybeLocal GetSharedArrayBufferFromId( diff --git a/src/workerd/jsg/string.h b/src/workerd/jsg/string.h index ea3bfa7858c..c43166be80b 100644 --- a/src/workerd/jsg/string.h +++ b/src/workerd/jsg/string.h @@ -387,7 +387,7 @@ inline KJ_WARN_UNUSED_RESULT UsvString usv(UsvString&& other) { return kj::mv(ot inline KJ_WARN_UNUSED_RESULT UsvString usv(UsvStringPtr other) { return other.clone(); } // Make a UsvString from a string literal (assumed to be UTF-8 encoded) -// reinterpretd as a sequence of UTF-16 Unicode code units. The underlying +// reinterpreted as a sequence of UTF-16 Unicode code units. The underlying // storage of utf16_t code units will be heap allocated. inline KJ_WARN_UNUSED_RESULT UsvString usv(const char* string) { return usv(kj::toCharSequence(string)); diff --git a/src/workerd/jsg/type-wrapper.h b/src/workerd/jsg/type-wrapper.h index ad217f8689f..528d96873ea 100644 --- a/src/workerd/jsg/type-wrapper.h +++ b/src/workerd/jsg/type-wrapper.h @@ -327,7 +327,7 @@ class TypeWrapperBase, JsgKind::EXTENSI // static constexpr const char* getName(T* dummy); // // Return the name of the type for the purpose of TypeError exception messages. Note that // // you can also return `const std::type_info&` here, in which case the type name will -// // be derived by stripping off the namespase from the C++ type name. +// // be derived by stripping off the namespace from the C++ type name. // // v8::Local wrap(v8::Local jsContext, // kj::Maybe> creator, diff --git a/src/workerd/jsg/util.h b/src/workerd/jsg/util.h index 65e11369603..400d87d3f7d 100644 --- a/src/workerd/jsg/util.h +++ b/src/workerd/jsg/util.h @@ -283,10 +283,10 @@ struct LiftKj_ { info.GetReturnValue().Set(func()); } } catch (kj::Exception& exception) { - // This throwInteralError() overload may decode a tunneled error. While constructing the + // This throwInternalError() overload may decode a tunneled error. While constructing the // v8::Value representing the tunneled error, it itself may cause a JS exception to be // thrown. This is the reason for the nested try-catch blocks -- we need to be able to - // swallow any JsExceptionThrowns that this catch block generates. + // swallow any JsExceptionThrown exceptions that this catch block generates. throwInternalError(isolate, kj::mv(exception)); } } catch (JsExceptionThrown&) { @@ -331,7 +331,7 @@ struct LiftKj_> { // returnRejectedPromise() may decode a tunneled error. While constructing // the v8::Value representing the tunneled error, it itself may cause a JS exception to be // thrown. This is the reason for the nested try-catch blocks -- we need to be able to - // swallow any JsExceptionThrowns that this catch block generates. + // swallow any JsExceptionThrown exceptions that this catch block generates. returnRejectedPromise(info, makeInternalError(isolate, kj::mv(exception)), tryCatch); } } catch (JsExceptionThrown&) { diff --git a/src/workerd/jsg/value.h b/src/workerd/jsg/value.h index fd3b48406a2..7d7fc711db6 100644 --- a/src/workerd/jsg/value.h +++ b/src/workerd/jsg/value.h @@ -571,7 +571,7 @@ class MaybeWrapper { } // The constructor here is a bit of a hack. The config is optional and might not be a JsgConfig - // object (or convertable to a JsgConfig) if is provided. However, because of the way TypeWrapper + // object (or convertible to a JsgConfig) if is provided. However, because of the way TypeWrapper // inherits MaybeWrapper, we always end up passing a config option (which might be std::nullptr_t) // The getConfig allows us to handle any case using reasonable defaults. MaybeWrapper(const auto& config) : config(getConfig(config)) {} @@ -738,7 +738,7 @@ class OneOfWrapper { // Requests and Responses into Initializers without them being interpreted as dictionaries. I // believe this is actually what the Web IDL spec prescribes anyway, but verify. // - // TOOD(someday): Prove that this is the same algorithm as the one defined by Web IDL. + // TODO(someday): Prove that this is the same algorithm as the one defined by Web IDL. kj::OneOf result; if (unwrapHelper(context, handle, result) || unwrapHelper(context, handle, result) @@ -1067,8 +1067,8 @@ class DateWrapper { // KJ uses nanoseconds stored as an int64_t, which is significantly smaller but larger // than my lifetime. // - // For most usecases, throwing when we encounter a date outside of KJ's supported range is OK. - // API's that need to support time-travellers or historians may need to consider using the + // For most use-cases, throwing when we encounter a date outside of KJ's supported range is OK. + // API's that need to support time-travelers or historians may need to consider using the // V8 Date type directly. constexpr double millisToNanos = kj::MILLISECONDS / kj::NANOSECONDS; double nanos = millis * millisToNanos;