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

Change Symbol to Token to avoid conflict with native Symbol in webpacked files. (mathjax/MathJax#3072) #982

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Aug 11, 2023

This PR changes the Symbol class name to Token so that it doesn't conflict with the native Symbol object in webpacked files. Webpacking of ESM files handles the exports from the component lib files as global variables, and that means the Symbol object will overwrite the native one, and since the webpack initialization code refers to Symbol before that const Symbol is set up, that cause a compile error. (The old CommonJS modules.export approach didn't use separate global variables, so didn't have that problem.)

Along with this, it renames SymbolMap to TokenMap, and changes variables called symbol to token, where appropriate.

Unfortunately, this touches a lot of files.

Resolves issue mathjax/MathJax#3072.

@dpvc dpvc requested a review from zorkow August 11, 2023 18:09
@dpvc dpvc added this to the v4.0 milestone Aug 15, 2023
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not review all files in detail. I built, tested in the lab and with my own test page. It works fine.

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