Skip to content

Commit

Permalink
Use LoggyIntf.expectInstanceOrNull().
Browse files Browse the repository at this point in the history
  • Loading branch information
danfuzz committed Dec 9, 2024
1 parent e62c578 commit 86be1be
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/metacomp/export/LimitedLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class LimitedLoader {
*/
constructor(context = null, logger = null) {
this.#context = context;
this.#logger = logger;
this.#logger = IntfLogger.expectInstanceOrNull(logger);

if (context && !vm.isContext(context)) {
vm.createContext(context);
Expand Down
2 changes: 1 addition & 1 deletion src/net-protocol/export/ProtocolWrangler.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class ProtocolWrangler {
* logging.
*/
async init(logger) {
this.#logger = logger;
this.#logger = IntfLogger.expectInstanceOrNull(logger);

// Confusion alert!: This is not the same as the `requestLogger` (a "request
// logger") per se) passed in as an option. This is the sub-logger of the
Expand Down
2 changes: 1 addition & 1 deletion src/net-protocol/private/AsyncServerSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class AsyncServerSocket {
// Note: `interface` is a reserved word.
this.#interface = MustBe.instanceOf(iface, InterfaceAddress);
this.#protocol = MustBe.string(protocol);
this.#logger = logger;
this.#logger = IntfLogger.expectInstanceOrNull(logger);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/net-protocol/private/WranglerContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ export class WranglerContext {
ctx.#socket = socket;

if (logger) {
ctx.#connectionLogger = logger;
ctx.#connectionId = logger.$meta.lastContext;
ctx.#connectionLogger = IntfLogger.expectInstanceOrNull(logger);
ctx.#connectionId = logger?.$meta.lastContext ?? null;
}

ctx.bind(socket);
Expand Down
2 changes: 1 addition & 1 deletion src/net-util/export/DispatchInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class DispatchInfo extends IntfDeconstructable {

this.#base = MustBe.instanceOf(base, PathKey);
this.#extra = MustBe.instanceOf(extra, PathKey);
this.#logger = (logger === null) ? null : MustBe.callableFunction(logger);
this.#logger = IntfLogger.expectInstanceOrNull(logger);
}

/** @override */
Expand Down
2 changes: 1 addition & 1 deletion src/webapp-core/export/HostManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class HostManager extends TemplAggregateComponent('HostAggregate', BaseCo
* @param {?IntfLogger} logger Logger to use, if any.
*/
constructor(logger) {
this.#logger = logger;
this.#logger = IntfLogger.expectInstanceOrNull(logger);
}

/**
Expand Down

0 comments on commit 86be1be

Please sign in to comment.