jupyterlite / cockle

In-browser bash-like shell implemented in TypeScript.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Check WASM module properties exist before using #13

Closed ianthomas23 closed 3 months ago

ianthomas23 commented 3 months ago

For WASM modules containing commands, we currently use the properties callMain, ENV, FS and getEnvStrings. callMain is always required as otherwise we can't call the command, but the others are optional and are only required for commands that access the filesystem (FS) or get/set environment variables (ENV, getEnvStrings). The PR checks for the existence of these properties before using them, throws an error if callMain is missing but otherwise continues if any of the others are missing.