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 generation #3756

Closed
eco747 opened this issue May 7, 2024 · 3 comments
Closed

invalid code generation #3756

eco747 opened this issue May 7, 2024 · 3 comments

Comments

@eco747
Copy link

eco747 commented May 7, 2024

compiling this typescript code with esbuild 0.21.0

const t = {
	get passive ( ) {
		return false;
	}
}
console.log(t);

generate this javascript

var t = {
  get passive: /* @__PURE__ */ __name(function() {
    return false;
  }, "passive")
};
console.log(t);

this is syntactically incorrect

get passive: _name(xxx)
           ^  here

with these options:

"bundle": true,
"format": "esm",
"platform": "browser",
"charset": "utf8",
"keepNames": true,
"target": "esnext"
@eco747
Copy link
Author

eco747 commented May 7, 2024

This probleme was not present in 0.20.x version
This is due to keepnames=true, if I use keepNames=false, obviously the problem disapear.

@GentileFulvio
Copy link

Same issue here

@evanw
Copy link
Owner

evanw commented May 7, 2024

Thanks for the report. Working on it.

@evanw evanw closed this as completed in e7a9256 May 7, 2024
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

3 participants