Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't use
globalThis
when using this
Without "use strict", `this` will be set to `globalThis` which is typically the window object. If certain properties are set on the window object (e.g. "window.target"), this can cause problems for the `css` and `styled` functions. Instead, check that `this` has been set to something other than `globalThis` before using it. This ensures that `this` will only have a value if it is explicitly bound, and otherwise will be `undefined`. Note: I tried to add "use strict"; directives where needed, but couldn't get them to "survive" the build process -- they were removed. This fix seems to work just fine. Closes cristianbote#545
- Loading branch information