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

with() from dist/options.js causing SyntaxError in ECMAScript classes #16

Open
Baedda opened this issue Jun 13, 2022 · 0 comments
Open

Comments

@Baedda
Copy link
Contributor

Baedda commented Jun 13, 2022

In line 151 inside dist/options.js the with statement is used. This is what MDN says about the use of with:

Warning: Use of the with statement is not recommended, as it may be the source of confusing bugs and compatibility issues. See the "Ambiguity Contra" paragraph in the "Description" section below for details.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with

We are facing the issue, that if we import options.js from node_modules with a bundler that outputs an EcmaScript module the code breaks in the browser with the following SyntaxError:

strict mode code may not contain 'with' statements

We cannot disable strict mode as we are in an ESM environment using ECMAScript classes that are always strict.

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