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

Tests for "silent" const violations #531

Open
overlookmotel opened this issue Oct 20, 2023 · 0 comments
Open

Tests for "silent" const violations #531

overlookmotel opened this issue Oct 20, 2023 · 0 comments
Labels
dev Issue related to dev or tests

Comments

@overlookmotel
Copy link
Owner

A "silent" const is a function expression name which cannot be assigned to, but which doesn't throw an error when assigned to in sloppy mode code.

These are handled correctly in functions. e.g.:

// Sloppy mode
module.exports = function f() {
  f = console.log('hello!');
};

Output:

module.exports = function f() {
  console.log('hello!'); // `f =` assignment removed
};

However, while writing fix for #528, I realised there are no tests for this.

@overlookmotel overlookmotel added enhancement Improvements dev Issue related to dev or tests and removed enhancement Improvements labels Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Issue related to dev or tests
Projects
None yet
Development

No branches or pull requests

1 participant