seanmorris / php-wasm

PHP in Browser, powered by WebAssembly.
https://seanmorris.github.io/php-wasm/
Apache License 2.0
606 stars 32 forks source link

few small improvements #29

Open jimmywarting opened 1 year ago

jimmywarting commented 1 year ago

using if(window && document) in NodeJS did not particularly work inside of NodeJS or worker. window is undefined so a real check have to do: if (typeof window !== undefined ...)

otherwise you get the unhandled type error: window is not defined

but something better would be to use globalThis that exist in all environment.