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

Wrong navigator variable scope handling(?) #643

Open
KenjiTakahashi opened this issue Jan 3, 2025 · 0 comments
Open

Wrong navigator variable scope handling(?) #643

KenjiTakahashi opened this issue Jan 3, 2025 · 0 comments

Comments

@KenjiTakahashi
Copy link

There happens to be this code in billboard.js:

function convertInputType(mouse: boolean, touch: boolean): "mouse" | "touch" | null {
    const {DocumentTouch, matchMedia, navigator} = window;
    // rest of the code
}

which gets transpiled to:

function convertInputType(mouse, touch) {
  var DocumentTouch = win.DocumentTouch, matchMedia = win.matchMedia, navigator = win.navigator;
  // rest of the code
}

Both of these define a local variable with the name of navigator inside the function.

For some reason, the plugin seems to think that this overrides the global navigator object and stops reporting any compatibility issues related to navigator in the entire project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant