Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit 9a9dfc1

Browse files
committed
Ease linters
1 parent 673dc77 commit 9a9dfc1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/worker.ts

+10-12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let raw_xserver: any;
99

1010
async function waitRunDependency() {
1111
const promise = new Promise((r: any) => {
12+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1213
// @ts-ignore
1314
globalThis.Module.monitorRunDependencies = (n: number) => {
1415
if (n === 0) {
@@ -20,8 +21,10 @@ async function waitRunDependency() {
2021
// If there are no pending dependencies left, monitorRunDependencies will
2122
// never be called. Since we can't check the number of dependencies,
2223
// manually trigger a call.
24+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2325
// @ts-ignore
2426
globalThis.Module.addRunDependency('dummy');
27+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2528
// @ts-ignore
2629
globalThis.Module.removeRunDependency('dummy');
2730
return promise;
@@ -42,30 +45,25 @@ ctx.get_stdin = get_stdin;
4245
// @ts-ignore: breaks typedoc
4346
let resolveInputReply: any;
4447

45-
async function loadCppModule(moduleFactory: any): Promise<any> {
48+
async function load() {
4649
const options: any = {};
47-
// @ts-ignore
48-
globalThis.Module = await moduleFactory(options);
50+
51+
importScripts('./xpython_wasm.js');
4952

5053
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5154
// @ts-ignore
52-
importScripts(require('./python_data'));
55+
globalThis.Module = await createXeusModule(options);
56+
57+
importScripts('./python_data.js');
5358

5459
await waitRunDependency();
60+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5561
// @ts-ignore
5662
raw_xkernel = new globalThis.Module.xkernel();
5763
raw_xserver = raw_xkernel.get_server();
5864
raw_xkernel!.start();
5965
}
6066

61-
async function load() {
62-
// @ts-ignore
63-
let xpython = importScripts(require('./xpython_wasm.js'));
64-
65-
// @ts-ignore
66-
return loadCppModule(createXeusModule);
67-
}
68-
6967
const loadCppModulePromise = load();
7068

7169
ctx.onmessage = async (event: MessageEvent): Promise<void> => {

0 commit comments

Comments
 (0)