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

Prevent setting a propery that has a getter. (mathjax/MathJax#3098) #1001

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Sep 14, 2023

This PR resolves a problem that occurs when combineConfig() or combineWithMathJax() are used to merge an object into the MathJax._ object and the item to be set is already set and has a getter. This occurs due to the way exports are handled in ESM modules, where the exports are in an object each with a getter (so that they can't be modified, as imports are supposed to be immutable). That didn't seem to be the case for the CJS components we used to use. As a consequence, changing the renderer now causes an error since both the CHTML and SVG components include the common output code, and both set the properties of MathJax._.output.common, which are all getters. This produces errors.

Resolves the console error issue from mathjax/MathJax#3098.

@dpvc dpvc requested a review from zorkow September 14, 2023 14:16
@dpvc dpvc added this to the v4.0 milestone Sep 14, 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.

typos.
o/w lgtm.

* @param {any} src The source configuration object (to replace defaul values in dst}
* @return {any} The resulting (modified) config object
* @param {any} dst The destination config object (to be merged into)
* @param {any} src The source configuration object (to replace defaul values in dst}
Copy link
Member

Choose a reason for hiding this comment

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

typo

* @return {any} The resulting (modified) config object
* @param {any} dst The destination config object (to be merged into)
* @param {any} src The source configuration object (to replace defaul values in dst}
* @param {boolean} check True when combining into MathJax._ to avoid setting getter properties
Copy link
Member

Choose a reason for hiding this comment

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

typo

@dpvc dpvc merged commit b9d7b93 into develop Sep 15, 2023
@dpvc dpvc deleted the issue3098a branch September 15, 2023 12:37
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