Skip to content

Commit e42bee2

Browse files
fix bad type
1 parent fd0941b commit e42bee2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kernel/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
UserspaceProcessManager
1313
} from "./processes";
1414
import type {AbstractShell} from "../abstract_shell";
15+
import {ProgramMainData} from "../types";
1516

1617
import {NEWLINE, type WrappedTerminal} from "./term_ctl";
1718

@@ -293,7 +294,7 @@ export class Kernel {
293294
const process = this.#process_manager.create_process(parsed_line, shell);
294295

295296
// protect from pollution
296-
const data = Object.create(null);
297+
const data = Object.create(null) as ProgramMainData<unknown>;
297298

298299
// provide either privileged or userspace kernel access
299300
if (start_privileged) {
@@ -314,7 +315,7 @@ export class Kernel {
314315
// create a promise that resolves when the program completes
315316
let result_promise: Promise<number>;
316317
if ("main" in program) {
317-
result_promise = Promise.resolve(program.main(data));
318+
result_promise = Promise.resolve(program.main(data as ProgramMainData));
318319
} else {
319320
throw new Error("Invalid program type");
320321
}
@@ -552,7 +553,7 @@ export class Kernel {
552553
* @param process The process to create the proxy for.
553554
* @returns A {@link UserspaceKernel} proxy of this kernel.
554555
*/
555-
create_userspace_proxy(process: ProcessContext): Promise<UserspaceKernel> {
556+
create_userspace_proxy(process: ProcessContext): UserspaceKernel {
556557
// eslint-disable-next-line @typescript-eslint/no-this-alias
557558
const self = this;
558559
const proxy = Object.create(null);

0 commit comments

Comments
 (0)