Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't use globalThis when using this #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 6, 2023

  1. 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
    jluxenberg committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    7a26f07 View commit details
    Browse the repository at this point in the history