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

Commit

Permalink
Ease linters
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed May 17, 2022
1 parent 673dc77 commit 68427dc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/worker.ts
Expand Up @@ -9,6 +9,7 @@ let raw_xserver: any;

async function waitRunDependency() {
const promise = new Promise((r: any) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
globalThis.Module.monitorRunDependencies = (n: number) => {
if (n === 0) {
Expand All @@ -20,8 +21,10 @@ async function waitRunDependency() {
// If there are no pending dependencies left, monitorRunDependencies will
// never be called. Since we can't check the number of dependencies,
// manually trigger a call.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
globalThis.Module.addRunDependency('dummy');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
globalThis.Module.removeRunDependency('dummy');
return promise;
Expand All @@ -44,24 +47,32 @@ let resolveInputReply: any;

async function loadCppModule(moduleFactory: any): Promise<any> {
const options: any = {};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
globalThis.Module = await moduleFactory(options);

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
importScripts(require('./python_data'));
// eslint-disable-next-line @typescript-eslint/no-var-requires
importScripts(require('./xpython_wasm.js'));

await waitRunDependency();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
raw_xkernel = new globalThis.Module.xkernel();
raw_xserver = raw_xkernel.get_server();
raw_xkernel!.start();
}

async function load() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
let xpython = importScripts(require('./xpython_wasm.js'));
// eslint-disable-next-line @typescript-eslint/no-var-requires
importScripts(require('./python_data.js'));

console.log('hey');

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return loadCppModule(createXeusModule);
}
Expand Down

0 comments on commit 68427dc

Please sign in to comment.