mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
* Add runtime.invalidate_module_path_cache() to clear importlib's cache of modules * Clear cache after [[fetch]], after plugin files download, after plugins setup, and prior to py-script tag execution.
44 lines
966 B
TypeScript
44 lines
966 B
TypeScript
import { Runtime } from "../../src/runtime"
|
|
import type { PyodideInterface } from 'pyodide';
|
|
|
|
export class FakeRuntime extends Runtime {
|
|
|
|
src: string;
|
|
name?: string;
|
|
lang?: string;
|
|
interpreter: PyodideInterface;
|
|
globals: any;
|
|
|
|
constructor() {
|
|
super(null);
|
|
}
|
|
|
|
async run(code: string) {
|
|
/* don't do anything */
|
|
}
|
|
|
|
async loadInterpreter() {
|
|
throw new Error("not implemented");
|
|
}
|
|
|
|
registerJsModule(name: string, module: object) {
|
|
throw new Error("not implemented");
|
|
}
|
|
|
|
async loadPackage(names: string | string[]) {
|
|
throw new Error("not implemented");
|
|
}
|
|
|
|
async installPackage(package_name: string | string[]) {
|
|
throw new Error("not implemented");
|
|
}
|
|
|
|
async loadFromFile(path: string, fetch_path: string) {
|
|
throw new Error("not implemented");
|
|
}
|
|
|
|
invalidate_module_path_cache(): void {
|
|
throw new Error("not implemented");
|
|
}
|
|
}
|