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

invalid code is generated if a semicolon is omitted after setting a property on an object to an arrow function on the line before an iife #701

Closed
LinusCenterstrom opened this issue Jan 21, 2021 · 1 comment

Comments

@LinusCenterstrom
Copy link

The original code is generated by webpack (can provide if wanted).

But a minimal example is this.
source:

const a = {};
a.g = () => {}
(function(){
  console.log("test");
})();

output:

const a = {};
(a.g = () => {
})(function() {
  console.log("test");
})();

From what I could gather defining an arrow function should cause automatic semicolon insertion which is why the source is even valid in the first place.

@LinusCenterstrom LinusCenterstrom changed the title invalid code is generated if a semicolon is omitted after setting a property on an object to a arrow function on the line before an iife invalid code is generated if a semicolon is omitted after setting a property on an object to an arrow function on the line before an iife Jan 21, 2021
@evanw
Copy link
Owner

evanw commented Jan 21, 2021

Thanks so much for reporting this. Will fix.

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

Successfully merging a pull request may close this issue.

2 participants