Skip to content

invalid code generation #3756

Closed
Closed
@eco747

Description

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"

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions