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

Allow specifying the original name of nodes #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iBelieve
Copy link

@iBelieve iBelieve commented May 3, 2020

@michaelficarra
Copy link
Member

We can't do this. estree AST nodes are today allowed to have fields other than those specified by estree. Some of those nodes may have an originalName property that was not meant to cause codegen to behave like this. Additionally, how do you know that the code generator isn't being used to output the minified names?

I think you should start by explaining the problem you have so we can discuss solutions to it.

@iBelieve
Copy link
Author

iBelieve commented May 5, 2020

@michaelficarra The linked issue already explains the problem and essentially proposes this solution: estools/esmangle#85. Without this fix, source maps don't include the original identifiers, and incorrectly include the minified names. This means that for example stack traces will refer to minified function names. With this fix, you can see the original, un-minified function names in the stack trace.

@michaelficarra
Copy link
Member

@iBelieve Okay, I think I was misreading this PR. It doesn't change the actual source text generation, just the names used in the source map, is that correct? Can you add tests that Identifier nodes that have both a name and an originalName still codegen using the name?

@michaelficarra michaelficarra reopened this May 5, 2020
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 this pull request may close these issues.

None yet

2 participants