You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for setting initialization-time script location (#278)
This adds an `--init-location` CLI arg that can be used to set a location for use during wizening. This is meant to enable working around issues with libraries that use `globalThis.location` during top-level evaluation.
An example of a library that does this, and is used as a dependency in a number of projects, is [cfworker](https://github.com/cfworker/cfworker/blob/b9a093a54ba81ef58960cb43574169df021ecc70/packages/json-schema/src/dereference.ts#L68-L75).
The location will not be used for anything runtime-internal. Specifically, it'll not be used to resolve relative paths for module loading purposes or file handling in general.
This also adds some needed test infrastructure and two tests: one for trying to use `globalThis.location` in top-level code without using `--init-location`, and another for successfully using it with the arg.
0 commit comments