Skip to content

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

Description

@Baedda

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions